The DEFINE STRUCTURE statement specifies a named structure or union type.
Any string lengths, area sizes, or array dimensions specified in a DEFINE STRUCTURE statement must be restricted expressions.
Missing data attributes are supplied using PL/I defaults.
Please note these restrictions:
For example, if a structure contains an aligned fixed bin(31) field as its most stringently aligned item, then these restrictions say:
The DEFINE STRUCTURE statement defines a "strong" type. In other words, variables declared with that type can only be assigned to variables (or parameters) having the same type. Typed structures can not be used in data-directed input/output statements.
A DEFINE STRUCTURE statement that merely names the structure to be defined without specifying any of its members defines an "unspecified structure".
Unspecified structure definitions are useful when a structure definition contains is a handle to a second structure which also contains is a handle to the first structure. For instance, in the following example, the parent structure contains a handle to the child structure, but the child structure also contains a handle to the parent structure.
define structure 1 child;
define structure
1 parent,
2 first_child handle child,
2 parent_data fixed bin(31);
define structure
1 child,
2 parent handle parent,
2 next_child handle child,
2 child_data fixed bin(31);