Managing Memory and Data Access
16.4 Using Alignment Directives, Qualifiers, and Flags
16.4 Using Alignment Directives, Qualifiers, and Flags
Alignment directives offer flexibility and selectivity: they alter the current
alignment by specifying new alignment information from within the source
program.
The forms of the alignment directives are as follows:
*DC SET ALIGNMENT
*DC SET NOALIGNMENT
*DC END-SET ALIGNMENT
*DC SET PADALIGN
*DC SET NOPADALIGN
*DC END-SET PADALIGN
The *DC SET ALIGNMENT directive and the *DC SET PADALIGN directive
function independently of each other, except when their scopes overlap in
the program source. In case of overlapping scope, the effect of the *DC SET
PADALIGN directive prevails.
The *DC SET ALIGNMENT directive specifies natural Alpha alignment of
elementary data items. The *DC SET PADALIGN specifies Alpha natural
alignment and padding.
The *DC SET NOALIGNMENT directive specifies OpenVMS VAX compatible
alignment.
The optional *DC END-SET ALIGNMENT directive terminates the current *DC
SET ALIGNMENT or *DC SET NOALIGNMENT directive that is currently in
effect.
The alignment of binary data that has been specified with the SYNCHRONIZED
clause is unaffected by the *DC SET ALIGNMENT and *DC SET PADALIGN
directives.
When you use an alignment directive or qualifier to align data in records, you
should consider whether the data will be written to a file to be accessed by
applications written in Compaq COBOL for OpenVMS VAX.
Note
These directives are not allowed in the PROCEDURE DIVISION of a
program source.
16.4.1 Order of Alignment Operations
Table 16–2 shows the order of precedence of the primary alignment qualifiers and
directives in Compaq COBOL.
16–6 Managing Memory and Data Access