Group definition
A group is a set of elementary Data Elements. In the table or in the Group definition section, you indicate the name and label of the group, and other options such as occurs and sort. If you click Redefine in the definition section, you can redefine a Data Element that has the COBOL same level. You can also define or modify the -G lines of the group.
A group is a set of elementary Data Elements. You can add up to 99 elementary Data Elements to a group, on nine different levels maximum. A group can include other groups. All elementary elements are then counted to define the group. A group can also include one or more Segments. Each Segment called in a group is considered as an elementary Data Element. The group Data Element can be defined at the repository level. If so, its length is automatically recalculated (sum of the lengths of the elementary Data Elements) regardless of its repository format. If the group is used as a key (sort key or access key), then the combined formats of the elementary Data Elements must still be compatible with the format you have indicated for the group. When you create a group, it does not contain any elementary Data Element, it is empty. You must add the Data Elements to the group then.
- Name
- Enter the code of the group. It is free, but cannot exceed 6 characters. You can change the
group code or label at any moment, after the group is created.
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.
- Label
- Enter a label of the group. It is free but cannot exceed 36 characters. You can change the group label at any moment after the group is created.
- Occurs
- This field represents the OCCURS clause of an elementary Data Element, a group, or a filler. The restrictions of the COBOL OCCURS clause apply.
- Sort key
- This field identifies all the Data Elements that can be used as
control break sort keys, or as access keys to a file, a database or
a Pactables Table.Note: It is advised to dedicate a Segment to only one type of use. Each Data Element that can belong to a sort key must be referenced by a unique alphabetic or numeric character. It is advised to reference the indicators by a series (1, 2, 3 for example). The actual sort sequence is selected at the Program level (on the -CD Lines tab).You must not forget that the format of key group Data Elements must have been entered in the repository or at the Segment level.
Table 1. Possible values of the sort key for Pactables Value Comments U References the access key for a Table. This value must be indicated on the group Data Element if it is a group key. S Indicates that the Data Element belongs to at least one subsystem. Table 2. Possible values of the sort key for DL/1 databases Values Comments U References a unique key for a DL/1 database. M References a multiple key for a DL/1 database. 1 - 9 Secondary index All other values designate a search field. Table 3. Possible values of the sort key for AS400 and relational databases Values Comments 0 - 9 AS400 physical file key. Relational databases. V Variable length column. Blank Fixed-length column. W For DB2® SQL, SQL/DS and ORACLE, generation of a variable length column (VARCHAR). L For DB2 SQL, SQL/DS and ORACLE, generation of a LONG VARCHAR. Note: Sort keys are not authorized on Data Elements redefining other Data Elements.
- Redefines
- Redefinition is possible within a Segment or Logical View. It
generates the COBOL REDEFINES clause. The Data Element
that contains this option redefines the Data Element of the same COBOL
level that precedes it in the -CE lines. If a Data Element that redefines
another Data Element is contained in a group, it is considered to
be an elementary Data Element. It must be taken into account in the
calculation of the number of Data Elements that are contained in a
group (except for DL/1 database Segments). Note: When Data Elements are redefined, their respective lengths are not taken into account. It is your responsibility. The redefined Data Element length is used for the address calculation. Redefined Data Elements are ignored when generating for the Database Description function. If the Redefines box is checked, no initial value can be entered.
- To redefine a Data Element, select the Redefines option. A Set of Redefines line is created in the -CE lines. It contains the redefined Data Element and the preceding Data Element of the same level in the tree structure. You must then define the Occurs option in the Set of Redefines section.
More
-G Lines
Click -G Lines to define -GC lines for the element that is called in the Segment.