Comparing Alignment Directive Effects; Using *Dc Set Alignment Directives - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Managing Memory and Data Access
16.4 Using Alignment Directives, Qualifiers, and Flags
Example 16–1 Using *DC SET ALIGNMENT Directives
.
.
.
Initially, OpenVMS VAX compatible alignment is specified either by
1
NOALIGNMENT or the absence of ALIGN on the compile command.
The SET ALIGNMENT directive specifies alignment along natural
2
boundaries, superseding the initial OpenVMS VAX compatible alignment.
The SET NOALIGNMENT directive specifies VAX compatible alignment; data
3
is now byte-aligned.
The END-SET ALIGNMENT directive terminates the alignment specified
4
with the previous SET directive (
again along the natural boundaries as specified by
directive.
This END-SET ALIGNMENT directive terminates the alignment specified
5
with the original directive (
OpenVMS VAX compatible as specified by the default command-line option.

16.4.3 Comparing Alignment Directive Effects

The alignment examples that follow illustrate the following important points:
Compaq COBOL for OpenVMS VAX and Compaq COBOL align 01 (and 77)
data items along different boundaries, as follows:
Compaq COBOL for OpenVMS VAX aligns 01 data records and items
along longword boundaries. It byte-aligns all other fields unless SYNC
has been specified.
Compaq COBOL aligns 01 records and items along quadword boundaries.
It byte-aligns all other fields unless SYNC or the alignment option has
been specified.
16–8 Managing Memory and Data Access
*DC SET ALIGNMENT
01 comp-group.
02 cg-x1
pic x.
02 cg-c1
pic 9(1) comp.
*DC SET NOALIGNMENT
01 comp-group-2.
02 cg-x2
pic x.
02 cg-c2
pic 9(1) comp.
*DC END-SET ALIGNMENT
01 comp-group-3.
02 cg-x3
pic x.
02 cg-c3
pic 9(1) comp.
*DC END-SET ALIGNMENT
01 comp-group-4.
02 cg-x4
pic x.
02 cg-c4
pic 9(1) comp.
1
2
3
4
5
SET NOALIGNMENT). Alignment is once
3
SET ALIGNMENT). Alignment is now
2
, the SET ALIGNMENT
2

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?

Questions and answers

Table of Contents