A PL/I host structure name can be a structure name with members that are not structures or unions. For example:
dcl 1 A,
2 B,
3 C1 char(...),
3 C2 char(...);
In this example, B is the name of a host structure consisting of the scalars C1 and C2.
Host structures are limited to two levels. A host structure can be thought of as a named collection of host variables.
You must terminate the host structure variable by ending the declaration with a semicolon. For example:
dcl 1 A,
2 B char,
2 (C, D) char;
dcl (E, F) char;
Host variable attributes can be specified in any order acceptable to PL/I. For example, BIN FIXED(31), BINARY FIXED(31), BIN(31) FIXED, and FIXED BIN(31) are all acceptable.
The following diagram shows the syntax for valid host structures.
>>-+-DECLARE-+--level--variable-name----------------------------> '-DCL-----' >--+----------------------+--,----------------------------------> '-Scope and/or storage-' .-,------------------------------------------. V | >----level--+-var-1-----------+--| Attributes |-+--;------------> | .-,-----. | | V | | '-(----var-2-+--)-' >--| Attributes: |----------------------------------------------> >------+-+-BINARY--+--+-FIXED--+-----------------------------+-+-+----->< | +-BIN-----+ | '-(--precision--+--------+--)-' | | | +-DECIMAL-+ | '-,scale-' | | | '-DEC-----' '-FLOAT--+-----------------+-------------' | | '-(--precision--)-' | '-+-CHARACTER-+--+---------------+--+---------+-----------' '-CHAR------' '-(--integer--)-' +-VARYING-+ '-VAR-----'