An example
of a structure field is as follows:
10 address;
20 street01 CHAR(20);
20 street02 CHAR(20);
The syntax diagram for a structure field is as follows:
- level
- Integer that indicates the hierarchical position of a structure field.
- structureFieldName
- Name of a structure field. For rules, see Naming conventions.
- *
- Indicates that the structure field describes a filler, which is
a memory area whose name is of no importance. An asterisk is not valid in
a reference to an area of memory, as noted in References to variables and
constants.
- primitiveType
- The primitive type assigned to the structure field.
- length
- The structure field's length, which is an integer. The value of a memory
area that is based on the structure field includes the specified number of
characters or digits.
- decimals
- For a numeric type (BIN, DECIMAL, NUM, NUMC, or PACF), you may specify decimals,
which is an integer that represents the number of places after the decimal
point. The maximum number of decimal positions is the smaller of two numbers:
18 or the number of digits declared as length. The
decimal point is not stored with the data.
- "dateTimeMask"
- For items of type INTERVAL or TIMESTAMP, you may specify "dateTimeMask",
which assigns a meaning (such as "year digit") to a given position in the
field value. The mask is present with the data at run time.
- dataItemPartName
- Specifies the name of a dataItem part that acts as a model of format for
the structure field being declared. For details, see typeDef.
- embed recordPartName
- Specifies the name of a record part and embeds the structure of that record
part into the current record. The embedded structure does not add a level
of hierarchy to the current record. For details, see typeDef.
- recordPartName
- Specifies the name of a record part and includes the structure of that
record part in the current record. In the absence of the word embed,
the record structure is included as a substructure of the structure field
being declared. For details, see typeDef.
- occurs
- The number of elements in an array of structure items. The default is
1, which means that the structure field is not an array unless you specify
otherwise. For details, see Arrays.
- property
- An field property, as described in Overview of EGL properties and overrides.