An elementary field description statement defines the characteristics of a field that is not subdivided into other fields.
1 – Syntax Rules
o The field name you assign can be up to 31 characters from the set A-Z, 0-9, _, and $. The first character must be a letter from A-Z, and the last character can not be _ or $. You can use 8-bit alphabetic characters in field names. o If you use an asterisk (*) instead of a field name, you create an unnamed field. o You must include the DATATYPE clause among the selected field attributes. o You must terminate the elementary field description statement with a period.
2 – Usage Notes
o Unnamed fields are similar to FILLER fields in COBOL. You can use them to format print records or to reserve space in a record for future additions. o All fields, except BIT fields, begin on the first byte following the preceding field. BIT fields begin on the bit immediately following the preceding field. You can modify this starting position with the ALIGNED clause.
3 – Example
NAME and ACCOUNT_NUMBER in the example below are elementary fields. CUSTOMER STRUCTURE. NAME DATATYPE IS TEXT SIZE IS 30 CHARACTERS. ACCOUNT_NUMBER DATATYPE IS UNSIGNED NUMERIC SIZE IS 7 CHARACTERS. END CUSTOMER STRUCTURE.