Fixed structure

A fixed structure establishes the format of a text form, print form, dataTable, or fixed-record part; and is composed of a series of fields that each describes an elemental memory location or a collection of memory locations, as in this example:

  10 workAddress;
    20 streetAddress1 CHAR(20);
       30 Line1 CHAR(10);
       30 Line2 CHAR(10);
    20 streetAddress2 CHAR(20);
       30 Line1 CHAR(10);
       30 Line2 CHAR(10);
    20 city CHAR(20);

You can define all the fields directly in the definition, as in the preceding example. Alternatively, you can indicate that all or a subset of the structure is equivalent to the structure that is in another fixed record part; for details, see Typedef.

Access to a field is based on a variable name, then a series of field names with a dot syntax. If you declare that the record myRecord includes the structure shown in the previous example, each of the following identifiers refers to an area of memory:
   myRecord.workAddress
   myRecord.workAddress.streetAddress1
   myRecord.workAddress.streetAddress1.Line1
An elementary structure field has no subordinate structure fields and describes an area of memory in either of these ways:
As shown earlier, a field in a fixed structure can have subordinate fields. Consider the next example:
  10 topMost;
    20 next01 HEX(4);
    20 next02 HEX(4);
When you define a superior structure field (like topMost), you have several options:
Note: The primitive type of a fixed-structure field determines the number of bytes in each unit of length; for details, see Primitive types.

Each elementary structure field has a series of properties, whether by default or as specified in the structure field. (The structure field may refer to a dataItem part that itself has properties.) For details, see Overview of EGL properties and overrides.

Related concepts
DataItem part
Fixed record parts
Overview of EGL properties
Parts
References to variables in EGL
Typedef

Related reference
Data initialization
EGL source format
Primitive types
SQL item properties

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.