Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

SCREEN COBOL Source Program
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
2-29
Data Representation
Data Representation
In the Working-Storage Section and Linkage Section, data items are stored in a certain
number of bytes; each byte is an 8-bit unit of storage. Bytes are grouped in pairs to form
words.
Data items whose usage (as defined by a USAGE clause) is DISPLAY occupy one byte
per character. Table 2-10
indicates the storage occupied by data items whose usage is
COMPUTATIONAL.
In the Screen Section, items do not have individual storage assigned; storage of these
items is of no consequence to SCREEN COBOL programming.
Standard Alignment
The standard rules for positioning data within an elementary item depend on the
category of the receiving item. The rules are as follows:
If the receiving data item is described as numeric, the sending data is aligned either
by decimal point with zero fill on either end of the value or by truncation on the low
end, as required. Truncation on the high end is not permitted, and if required, causes
suspension of the program. When no decimal point is specified, the receiving data
item is treated as if it had an assumed decimal point immediately following the
rightmost character.
If the receiving data item is described as alphanumeric or alphabetic, the sending
data is aligned at the leftmost character position in the data item with space fill or
truncation to the right as required.
Optional Alignment
Standard data representation and alignment rules are not always appropriate, so
provisions exist to override them. The JUSTIFIED clause can be used in the data
description to right justify data within a data item.
Sometimes a server requires that data items in messages be aligned on word boundaries.
Data items aligned on word boundaries are said to be synchronized. Synchronization
typically is achieved by organizing and describing data so that item boundaries coincide
with word boundaries. This task can be eliminated by using the SYNCHRONIZED
clause to force alignment of data items to their natural boundaries.
Table 2-10. Storage Occupied by COMPUTATIONAL Data Items
PICTURE Size in Digits Storage Occupied
1 through 4 2 bytes
5 through 9 4 bytes
10 through 18 8 bytes