The RECORD statement declares variables to be records with a specified structure, or declares arrays to be arrays of such records.
The syntax of a RECORD statement is:
RECORD /structure-name/ record-list [,/structure-name/ record-list] [,/structure-name/ record-list] | |
---|---|
structure-name | Name of a previously declared structure |
record-list |
List of variables, arrays, or arrays with dimensioning and index ranges, separated by commas. |
Example: A RECORD that uses the previous STRUCTURE example:
RECORD /PRODUCT/ CURRENT, PRIOR, NEXT, LINE(10)
Each of the three variables, CURRENT, PRIOR, and NEXT, is a record which has the PRODUCT structure; LINE is an array of 10 such records.
Note the following rules and restrictions for records:
Each record is allocated separately in memory.
Initially, records have undefined values, unless explicitly initialized.
Records, record fields, record arrays, and record-array elements are allowed as arguments and dummy arguments. When you pass records as arguments, their fields must match in type, order, and dimension. The record declarations in the calling and called procedures must match. Within a union declaration, the order of the map fields is not relevant. See "Unions and Maps ".
Record fields are not allowed in COMMON statements.
Records and record fields are not allowed in DATA, EQUIVALENCE, or NAMELIST statements. Record fields are not allowed in SAVE statements.