Group Fields


A group field (often referred to simply as a group) is a series of one or more fields with contiguous sequence numbers, which can be referenced by a single field name. The group field’s primary purpose is to simplify data assignments and comparisons between two sets of fields with matching contents, formats, and storage types. You can only reference a group field in a statement or within selection criteria, or specify it as a key.

You create a group by defining a group header and, optionally, a group trailer field.

·    A group header field marks the boundaries of a series of contiguous fields in a group, and provides a field name to reference the group. A specification entry on the group header overlay, Thru Field Name, also defines the last field in a group. The fields in a group are those with field sequence numbers that fall between the sequence numbers of the group header field and this last field. Any future additions to the group must have sequence numbers greater than the group header field and less than the Thru Field Name. You cannot add fields to the end of the group without modifying the Thru Field Name specification unless you use a group trailer field.

·    A group trailer field is an optional placeholder to mark the position of the final field in a group. It simplifies group maintenance by providing a streamlined mechanism to allow for future additions to the end of a group. You enter a group trailer field (rather than the final field in a group) in a Thru Field Name specification on the group header. When you use a group trailer to mark the end of a group, you can add new fields at the end without changing the Thru Field Name specification. It also provides a visual clue as to the end of the group when scanning the Data Dictionary. If a field’s sequence number is between the group header and group trailer, it belongs to the group.

When defining or using a group field, you must satisfy the following requirements:

·    Fields that comprise a group must have contiguous sequence numbers. This restriction should not be taken to imply that fields must be contiguous in terms of physical storage. Refer to the section entitled Special Uses for Synonym Fields for additional information.

·    A group can be nested (entirely contained within another group). For example, assume your GL account number is a group field (main account, sub account, division, and branch, perhaps). Further assume that your application contains a key field that is composed of the account number and a year (another group field). The account number group is nested within the account number/year group.

·    A group cannot partially overlap the fields in another group. In other words, two groups cannot share a component field without sharing all the component fields in one of the groups. You cannot, for example, define one group consisting of a year and an account number, and another using the same account number and an amount.

·    A group can be disjointed (entirely outside of any other group). If you define a synonym for the account number field in the previous example and use it to establish the second group, the two groups are disjointed. Because of the use of a synonym, the groups do not contain a common field.

·    A group cannot include a substring field.

·    A group must itself be a single occurrence, and must include all occurrences of any multiple-occurrence component fields.

·    The final field in a group (or group trailer field, if used) must have a sequence number that is greater than that of the group header field.

·    A group cannot be painted as an item on an image. Each component field must be painted individually. For example, you cannot paint an account number group on an input screen. You must, instead, individually paint its component main account, sub account, division, and branch fields on the image.