Table 16–2 Alignment and Padding Order of Precedence
Command line
Qualifier and
No Directive
Option
in Effect
(none)
None
/ALIGNMENT
Align
-align
elementary
data items.
/ALIGN=PAD
Align and pad
-align pad
elementary
data items and
structures.
16.4.2 Nesting Alignment Directives
Alignment directives located within the source program alter the current
alignment by specifying a new alignment. This new alignment remains in effect
(except for data specified with SYNCHRONIZED, which remains unchanged)
until changed precedence, or until the beginning of the next file specified in a
comma list.
You can nest alignment directives within a program to specify different
alignments for selected sets of data. Alignment directives modify the current
alignment in the following ways:
•
A SET ALIGNMENT (or SET NOALIGNMENT) directive. At this point in
the program source the alignment specified by this directive becomes the
current alignment.
•
An END-SET ALIGNMENT directive. At this point, the immediately
preceding SET ALIGNMENT (or SET NOALIGNMENT) directive is closed.
The current alignment now becomes one of the following:
— The alignment specified by the closest previous unclosed alignment
directive
— The alignment specified by the command-line option if no previous
alignment directive exists
•
The beginning of the next file specified in a comma list (on the Compaq
COBOL command line). This event closes all of the preceding alignment
directives. The alignment specified with the command-line option becomes
the current alignment.
Example 16–1 shows an example of nested alignment directives in source code.
Managing Memory and Data Access
16.4 Using Alignment Directives, Qualifiers, and Flags
Compiler Directives
*DC SET
*DC SET
ALIGNMENT
PADALIGN
Align
Align and pad
elementary
elementary
data items.
data items and
structures.
Align
Align and pad
elementary
elementary
data items.
data items and
structures.
Align
Align and pad
elementary
elementary data
data items and
items.
structures.
*DC SET
NOALIGN
None
None
None
Managing Memory and Data Access 16–7
Need help?
Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?