Data Alignment
In PL/I, data alignment might introduce gaps of unused space into a binary layout to ensure that all the fields are aligned at boundaries, as required by their type and the ALIGNED attribute.
Warning: The Plug-in is aware of these gaps and ensures correct parsing and rendering of aligned fields with one exception: An item that must be placed at a specific boundary cannot follow an item with the REFER option. For example, this code—
DECLARE 1 ROOT, 2 LEN_VAR FIXED BIN(31), 2 ARRAY(10 REFER(LEN_VAR)) FIXED BIN(15), 2 NUM FIXED BINARY(31);
—would cause an error because the FIXED BINARY field NUM, aligned at 4-byte boundary by default, follows a field with the REFER option.
However, in this example—
DECLARE 1 ROOT, 2 LEN_VAR FIXED BIN(31), 2 ARRAY(10 REFER(LEN_VAR)) FIXED BIN(15), 2 NUM FIXED BINARY(31) UNALIGNED;
—NUM is declared as unaligned and is allowed by the Plug-in.
Certain types, such as CHARACTER, do not have a requirement for alignment. In those cases, the ALIGNED attribute has no effect. For example, the following code does not cause an error even though the field CH contains the ALIGNED attribute:
DECLARE 1 ROOT, 2 LEN_VAR FIXED BIN(31), 2 ARRAY(10 REFER(LEN_VAR)) FIXED BIN(15), 2 CH CHAR ALIGNED;
Copyright © 2021. TIBCO Software Inc. All Rights Reserved.