Defining controls for the -CE lines in a Segment or Table
You can open a wizard to define or modify checks on each Data Element that is called in a Segment or Table. The Subschema belonging part of the wizard is active only if you indicate a S type of control in the More table.
This information is used by transaction files. A transaction file is made of records that update a permanent file. Transaction files are validated and update permanent files or databases. The type of update (creation, modification, deletion, or others) is called the action code. Validations and updates are automatically associated with each type of update. In the common part of the file, an action code Data Element represents the action code. You must associate six values with this Data Element, one for each type of update. Each value represents the input that the user indicates in the application to complete the appropriate update. If you do not specify any action code Data Element, all updates are considered as modifications.
Presence check
In this section, you must specify whether the presence of the Data Element is required, optional, or forbidden when the transaction file updates the permanent file or database for a Segment, or when the information is updated in a Table.- Creation
- You indicate whether the Data Element presence is required when the transaction file creates a record in the permanent file or database.
- Modification
- You indicate whether the Data Element presence is required when the transaction file modifies a record in the permanent file or database.
- Deletion
- You indicate whether the Data Element presence is required when the transaction file deletes a record in the permanent file or database.
- Type 4
- You indicate whether the Data Element presence is required when the transaction file updates a record in the permanent file or database. A type-4 action is a nonstandard action that you must describe entirely.
- Type 5
- You indicate whether the Data Element presence is required when the transaction file updates a record in the permanent file or database. A type-5 action is a nonstandard action that you must describe entirely.
- Type 6
- You indicate whether the Data Element presence is required when the transaction file updates a record in the permanent file or database. A type-6 action is a nonstandard action that you must describe entirely.
Values | Comments |
---|---|
None | No check. |
F: Optional | Default value. |
O: Required | Required. Generation of a level E (transaction refused) in standard error messages. |
P: Required (C error) | Required. Generation of a level C (Data Element rejected) in standard error messages. |
I: Forbidden | Not authorized. For relational databases, it indicates the presence of a column in a table. |
The values None, O, P, and I are carried over to the CMS456 field of the table. For example, if the Data Element presence is indicated as required when the transaction file modifies a record, a O is displayed in the M column of the Data Element call in the table.
- Class control
- You can select a class control that is specific to the Data Element
call. This control complements the Data Element format that is indicated
in the Data Element Definition. For example,
for a pure alphabetic alphanumeric Data Element, you can specify whether
it accepts lowercase or uppercase characters.
Table 2. Values for class control Values Comments None (recommended) Only the control that is generated automatically by the format is requested. A: Alphabetic For an alphanumeric Data Element, numeric and special characters are rejected. L: Lowercase alphabetic For an alphanumeric Data Element, only lowercase letters are accepted. This value is not available in the -CE lines of a Pactables Table.
U: Uppercase alphabetic For an alphanumeric Data Element, only uppercase letters are accepted. This value is not available in the -CE lines of a Pactables Table.
9: Numeric For an alphanumeric Data Element, alphabetic and special characters are rejected. B: Numeric after replacing leading blanks with zeros For a numeric Data Element, leading blanks are replaced with zeros. This value is not available in the -CE lines of a Pactables Table.
Z: Numeric after replacing all blanks with zeros For a numeric Data Element, all blank are replaced with zeros.
More
This table applies to the value of the Data Element in the user interface. You can control the value of the user input against a reference value or according to a control that is written with specific code. You can define the way the Data Element is updated. You can also define an initial value for the Data Element.
You can create more than one line for each Data Element call.
- Logical operator
- You use logical operators to link two consecutive lines. So, it
is impossible to select an operator on the first line. The following
values are available:
- E generates AND,
- O generates OR.
- Negation
- The negation applies to the selected Control type, when it is
=, >, or <. If you select
N, a NOT is generated before the control. Example: If the value that is entered by the user must be different from the value that you indicate in the Values/Subfunction field, you must select the negation N and the control type =.
- Control type
- You use this column to control the value of the user input according
to reference values or a control that is written with specific code.
You can also use it to specify the way the Data Element is updated
or to define an initial value for the Data Element. You can finally
use it to indicate useful complements for DL1 databases, relational
databases, or Pactables Tables.
This column is used in conjunction with the columns Values/Subfunction and Update Target.
Table 3. Control of the Data Element value. This table presents the control types that can be selected to control the value of the user input according to reference values or a control that is written with specific code. Values Comments = The value that is entered by the user must be equal to the value of the Values/Subfunction field. < The value that is entered by the user must be lower than the value of the Values/Subfunction field. > The value that is entered by the user must be greater than the value of the Values/Subfunction field. T The value that is entered by the user must belong to the table of the Update Target field. Content validations that are indicated after a T control type are not recognized. This value is not available in the -CE lines of a Pactables Table.
E The value that is entered by the user must be one of the values that are defined in the Data Element -D Lines. This value is not available in the -CE lines of a Pactables Table.
P The value that is entered by the user is controlled by a subfunction that is called by PERFORM. There can be only one control by PERFORM per Data Element called in a Segment. The following operations are run:
- The Data Element is transferred to the COBOL work area that is indicated in the Update Target field. You must declare the work area on each appropriate line.
- The subfunction that is indicated in the Values/Subfunction field is run. This subfunction can check and modify (as needed) the Data Element. The result of the validation is indicated in the error indicator (DEL-ER) that is generated automatically. This result is automatically transferred to the error table (DE-ERR) in the position that corresponds to the Data Element processed.
- The data is transferred from the work area to the initial Data Element, by incorporating any modifications made as a result of the performed function. This option is recommended for date validation, with possible inversion of the day and year. In this case, the date must be defined as an elementary Data Element. In the description of a Data Element in a transaction, a validation by PERFORM can be run before or after a content validation. If it is located before, it is run only if the Data Element is present with no error. If it is located after, it is run only if there is a content error. The value of the corresponding position in the DE-ERR table then becomes your responsibility.
Table 4. Definition of the type of update. This table presents the way the Data Element is updated. You can specify that the Data Element is updated in all cases or only if it conforms to the value control that is indicated for this Data Element call. You can also indicate that the Data Element is updated by adding a value to the user input or subtracting a value to it. Values Comments No value The Data Element is updated with the value that is entered by the user, only if this value conforms with the value control. M The Data Element is updated with the value that is entered by the user, whatever the result of the value control. This type of update can be used with group Data Elements. This value is not available in the -CE lines of a Pactables Table.
+ The Data Element is updated by adding the value of the Values/Subfunction column to the value that is entered by the user. The Data Element is updated only if this value conforms with the value control. - The Data Element is updated by subtracting the value of the Values/Subfunction column from the value that is entered by the user. The Data Element is updated only if this value conforms with the value control. Table 5. Definition of an initial value Values Comments V A VALUE clause is generated for the Data Element from the literal that is indicated in Values/Subfunction. The Generated description type field in the -CD Lines must authorize the generation of VALUE clauses. If the literal is not indicated, the value comes from the D-type line of the Data Element description.
This value is not available in the -CE lines of a Pactables Table.
W This value is similar to V but the literal can be continued in Update target. In this case, the values of the two columns are then considered as one. This value is not available in the -CE lines of a Pactables Table.
Table 6. Special usages Values Comments M This value is used for DL/1 databases. It is used to indicate a group key Data Element. The name of this Data Element is entered in Update Target, after A*.
S This value is used for Pactables and SQL relational databases. If you select this value and click another field to validate, the Subschema belonging part becomes available and you can select one or more subschemas.
If the Data Element belongs to a group Data Element, you must indicate a subschema on the group Data Element line.
D Date in DDMMYY format in a Pactables Table. I Date in YYMMDD format in a Pactables Table. K Date in DDMMCCYY format in a Pactables Table. L Date in CCYYMMDD format in a Pactables Table.
- Values/Subfunction
- The value in this field depends on the value of the Control
type field in the following way:
- With =, >, or <, enter the value to be compared.
- With P, enter the subfunction code to be performed.
- With +, –, or M, enter the value to be added, subtracted, or moved.
- With V, enter the literal to be used as the initial value.
- With W, enter the first part of the literal, which extends into the next column.
- With S, this column is in a read-only mode.
It displays a O to represent each subschema that
is selected in the Subschema belonging part.
The position of the O reflects the number of the
subschema that the Data Element belongs to.Example: This column displays O OO for subschemas 0, 2, and 3.
- Update target
- This field is used to specify the following elements:
- The target of the update for a permanent file. You must indicate the code in the program of the Data Structure to be updated (Usage set to P: Principal in the -CD Lines), or of the Table Data Structure if the control type is set to T.
- A counter that defines a variable number of repetitions. You must define the counter by entering **, followed by the Segment and Data Element. The OCCURS DEPENDING ON clause is generated. The transfers of the counter between the input, working, and output areas are completed automatically if this counter belongs to the common part.
- A working field used by the control by PERFORM, if the control type is set to P.
- The continuation of a literal for an initial value, if the control type is set to W. The value of this column is associated with the value of the preceding column for the update.
- The external name of a DL/1 field, if the control type is set to M. You must enter A*, followed by the code (on 8 characters) of the field that corresponds to the Data Element.
- The relational label of a column for an SQL relational database. You must enter A*, followed by the external name of the column.
A free reference is set when you indicate a Data Element in this field.
Content assist is available on this field, as shown by the symbol
in front of the field. To activate it, press Ctrl+Space. A subreference link is automatically created, even if the instance does not exist. From the target instance in the subreference results, you can start a super reference search.
If you put the cursor from the first to the fourth position of the field, the content assist wizard first displays the list of Segments. Select one of them, then click the field again and press Ctrl+Space again. The content assist then displays the list of Data Elements. Select one of them.
Subschema belonging
- Subschema 0 - 9
- You can specify that a Data Element or group belongs
to one or more subschemas by selecting the subschema check boxes. When you select a subschema, the Subschemas column in the -CE lines table displays a O on the call line. The position of the O reflects the number of the subschema.Example: This column displays O OO for the subschemas 0, 2, and 3.