Substring Fields
A substring field is a discrete portion of a longer alphanumeric field (specifically, an alpha, format, or text field or a domain-type field based on an alpha, format or text domain). For example, assume that a six-character account number field is coded so that the first four characters identify the type of account and the final two characters identify a geographic location. Processes that require the location value can access a substring field defined as the final two characters of the account number field.
A substring is defined for those instances where it is of benefit to access both a field in its entirety and a discrete segment of the field, depending upon the specific requirements of the operation or display. If you have not defined a substring, your only option is to manipulate the contents of the field itself with statements.
You can only define substrings for alphanumeric physical fields in the same record. They cannot reference synonyms, group headers, or group trailers, and a substring cannot be included as part of a group field or be referenced by a synonym field. In addition, the sequence number of a substring field must be greater than the sequence number of the alphanumeric field it references. Substring fields are limited to a single occurrence.
A substring occupies the same physical space as the alphanumeric field it is a part of. Its data is a subset of the data contained in that alphanumeric field. Any value that is established in the alphanumeric field is automatically established in the substring. The substring’s initial value is also a subset of the alphanumeric field’s initial value.
You can think of a substring as the inverse of a group field. The relationship between a substring and its alphanumeric field is similar to the relationship between a component field and its group. Whether you choose to define a field and various substrings, or a group and various component fields, impacts the appearance of fields on APPX images. A substring loses many of the edit characteristics of the alphanumeric field it references when it is painted on an image. Group fields do not. APPX requires you to paint the components of a group on an image, not the group itself, thereby ensuring that all the edit characteristics are maintained.
The Substring fields specifications overlay, shown in Figure 2-4-37, automatically displays after you complete the entries on the Fields specifications screen if the Field Type you select is SUBSTRING.
Figure 2-4-37. Substring Fields Overlay
The Substring fields overlay contains the following fields:
· Substring of identifies the alphanumeric field that is referenced by the substring. The field referenced must be an alpha, format, or text field or a domain-type field based on an alpha, format, or text domain. The sequence number for this field must be smaller than the sequence number that is assigned to the substring.
· Start Position determines the character position in the referenced field that represents the first character of the substring. For example, if phone number is defined as a format field with edit mask ###*###*####, the start position for a substring for the phone number exchange would be 5.
· Length designates the number of consecutive characters that comprise a substring field. The length of a substring cannot exceed the length of the alphanumeric field it references. This means that the sum of the value that is entered in this specification and the value in Start Position, less one, cannot exceed the length of the referenced field.
· Descriptive provides a longer, more easily understood alternative to Field Name, one that is not required to be unique within an application. If blank at all default levels, Field Name is used.
· Column Hdgs designates up to two lines of column heading text. The APPX output process facility uses this text to generate standard column heading images for Start of Page and Start of Range class frames. For cosmetic reasons, the length of headings should not exceed the length of a field itself. Refer to Standard Column Heading Image for additional information.