DDL Compiler Commands
Data Definition Language (DDL) Reference Manual — 426798-002
9- 60
FILLER Command
•
The DDL compiler compiles source code in several phases. In each phase DDL
evaluates records and definitions to see if filler bytes are necessary to make sure
the next field or group starts on a word boundary.
•
Where filler bytes are necessary, the DDL compiler inserts FILLER fields according
to the specified algorithm. Because the compiler uses the filler algorithm during
each phase of compilation, the compiler might insert FILLER fields during one
phase of compilation and remove the same FILLER fields during the next phase.
The DDL compiler continues inserting and removing FILLER fields according to the
specified filler algorithm until the source code is generated.
•
The DDL compiler removes only filler bytes generated by DDL; it never removes
user-specified filler bytes.
•
When the CFIELDALIGN_MATCHED2 command is set, DDL uses a modified,
extended FILLER 1. In this case, DDL ignores any FILLER 0 specification.
Filler Algorithm 0. If FILLER 0 is specified, the DDL compiler generates filler bytes
according to this algorithm:
•
If a field or group described with a REDEFINES clause does not start on a word
boundary, DDL inserts 1 byte of filler before the field or group being redefined,
even if the redefined field is the first element in a group.
•
If a single-item field or a group not described with a REDEFINES clause does not
start on a word boundary, DDL inserts one byte of filler before the field or group.
•
If the first element in a group not described with a REDEFINES clause does not
start on a word boundary, DDL inserts one byte of filler before the group.
•
If a group described with an OCCURS clause has both an odd number of bytes
and an element that does not start on a word boundary, DDL inserts 1 byte of filler
after the last element in the group. The filler bytes have the same level number as
the first element in the group. (DDL can remove this byte of filler in a subsequent
compilation phase.)
•
If the first element of a group not described with a REDEFINES clause is a byte of
filler generated by DDL and the group does not start on a word boundary, DDL
inserts another filler byte before the group. In a subsequent compilation phase,
DDL removes the filler byte from within the group.
Filler Algorithm 1. FILLER 1 works exactly like FILLER 0 except that FILLER 1 has an
additional rule that keeps user-defined TYPE definitions intact wherever they are used.
The rest of the algorithm for FILLER 1 is this:
•
For a group defined by a TYPE clause, the DDL compiler determines whether the
group the clause refers to starts on a word boundary.
•
If the group referred to starts on a word boundary, DDL does not insert any filler
bytes for the referring group.
•
If the group referred to does not start on a word boundary and is not described with
a REDEFINES clause, DDL inserts a filler byte before the referring group.