Compaq COBOL AAQ2G1FTK User Manual

Page 518

Advertising
background image

Managing Memory and Data Access
16.1 Managing Memory Granularity

granularity for best performance if you are sure the processes never make
concurrent updates within the same aligned quadword.

To successfully use byte/word granularity, you need to consider at least four
important restrictions:

An EV56 or higher CPU is necessary for byte/word granularity.

LIBOTS.EXE support for byte/word granularity is necessary if PIC X support
is needed. However, LIBOTS.EXE Version 1.3 on OpenVMS Alpha Version
7.1 does not support byte/word granularity.

Use of PIC 9 COMP-3 (PACKED numerics) and PIC 9 (DISPLAY numerics)
should be restricted, because they do not have byte/word granularity support.

You need to evaluate any NONGRNACC diagnostics as potentional sources of
incorrect data update. These warnings contain critical information and must
not be ignored.

You should avoid the use of /GRANULARITY=BYTE unless all of these
requirements are met.

In the following example (which is OpenVMS specific), the warnings at lines 16,
17, and 18 must be heeded. If this application is run on a CPU that supports
byte/word granularity, the warning at line 16 (PIC X) indicates that the move will
not produce byte granularity unless it is run on a system with a LIBOTS.EXE
version that supports byte/word granularity. The warnings at line 17 (PIC 9
display numeric) and line 18 (PIC 9 COMP-3 packed numeric) indicate that these
moves will not produce byte granularity.

$ cobol c3484/granularity=byte/list=sys$output
C3484

Source Listing

5-JUN-1999 07:37:22

Compaq COBOL V2.6-1060

Page 1

1 identification division.
2 program-id. c3484.
3 environment division.
4 data division.
5 working-storage section.
6 01 w1.
7 03

a1

pic 9(9) comp.

8 03

a2

pic 9(4) comp.

9 03

a3

pic x(9).

10 03

a4

pic 9(9).

11 03

w2 occurs 3 times.

12 05

a5 pic 9(18) comp-3.

13 procedure division.
14 0. move 1

to a1.

15

move 2

to a2.

16

move "c" to a3.

........1

%COBOL-W-NONGRNACC, (1) Unable to generate code for requested granularity

17

move 4

to a4.

........1

%COBOL-W-NONGRNACC, (1) Unable to generate code for requested granularity

18

move 5

to a5(2).

........1

%COBOL-W-NONGRNACC, (1) Unable to generate code for requested granularity

16–2 Managing Memory and Data Access

Advertising