Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Data Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
5-81
Clauses in Message Description Entry
Format Conversion Rules for PIC 1 Format (Bit Fields)
The following rules apply when data involving bit fields is passed through the Message
Section.
When a single field within the Message Section is defined as a PIC 1(n), the processing
performed is dependent on the associated Working-Storage data item type.
Input Operations
•
The source is a Message Section item. The destination is a Working-Storage
Section item.
•
For a Working-Storage PIC 9 COMP field, the data bits from the Message Section
item are placed into the least significant bit positions of the Working-Storage item.
There is high order zero fill or truncation if needed.
•
For a Working-Storage PIC 9 field, the binary numeric value is translated into the
ASCII characters that represent the decimal value of the field. If the Working-
Storage item cannot support the number, the error "value overflow" is reported and
the requester program is suspended, or an ON ERROR clause is activated.
•
For a Working-Storage PIC X field, the data bits from the Message Section item are
placed into the most significant bit positions of the Working-Storage item. There is
low order zero fill or truncation if needed.
•
For a Working-Storage PIC A field, the compiler detects and flags an error. A PIC
A field is composed of ASCII characters that must represent: A through Z, a
through z, or space.
•
Truncation rules for input operations
°
Truncation occurs when the destination is shorter than the source.
°
If the destination Working-Storage field is PIC X, trailing bits are truncated. No
indication of truncation is given to the application program.
°
If the destination Working-Storage field is PIC 9 COMP and that item cannot
support the size of the Message Section item, the following happens: the TCP
indicates that an overflow occurred by either suspending the requester program,
or by activating ON ERROR processing.
•
Filling rules for input operations
°
Filling occurs when destination is longer than source.
°
Destination Working-Storage PIC X fields are padded in the least significant
(trailing) portion of the field with nulls (binary zeros).
°
Destination Working-Storage PIC 9 fields are filled in the most significant
(leading) portion of the field with nulls (binary zeros).