Host structures in PL/I
A PL/I host structure is a structure that contains subordinate levels of scalars. You can use the name of the structure as shorthand notation to reference the list of scalars.
Requirements: Host structure
declarations in PL/I must satisfy the following requirements:
- Host structures are limited to two levels.
- You must terminate the host structure variable by ending the declaration with a semicolon, as in the following example:
DCL 1 A, 2 B CHAR, 2 (C, D) CHAR; DCL (E, F) CHAR;
- You can specify host variable attributes in any order that is acceptable to PL/I. For example, BIN FIXED(31), BIN(31) FIXED, and FIXED BIN(31) are all acceptable.
When you reference a host variable, you can qualify
it with a structure name. For example, you can specify STRUCTURE.FIELD
.
Host structures
The following diagram shows the syntax for declaring host structures.
Data types
The following diagram shows the syntax for data types that are used within declarations of host structures.
LOB data types
The following diagram shows the syntax for LOB data types that are used within declarations of host structures.
LOB data types for XML data
The following diagram shows the syntax for LOB data types that are used within declarations of host structures for XML data.
Example
In the following example, B is the
name of a host structure that contains the scalars C1 and C2.
DCL 1 A,
2 B,
3 C1 CHAR(...),
3 C2 CHAR(...);