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

Data Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
5-55
Field-Characteristic Clauses
Using a SHADOWED Clause
Using a shadow item usually involves the following operations:
The program tests the shadow item to determine the value of ENTER and RETURN
bits; these are set automatically by the ACCEPT statement depending on the data
entered.
The user programmatically sets the SELECT bit as desired by moving a value to the
shadow item.
Table 5-8
shows the possible values for a shadow item and the corresponding bit
patterns. The shadow item has different values depending on whether it is defined as
numeric (PIC 9 or PIC 9 COMP) or alphanumeric (PIC X).
For example, if a numeric shadow item equals 4, the screen field associated with the
shadow item held fill characters or blanks on the execution of the ACCEPT statement.
In this situation, program logic could provide for displaying the screen field again by
setting the SELECT bit. To set the SELECT bit, the program could move 5 to the
shadow item and maintain the existing bit pattern for the RETURN and ENTER bits.
An example of the SHADOWED clause is:
SCREEN SECTION.
01 LOCATION-REC-SCREEN BASE SIZE 24, 80.
05 STATE-FIELD AT 5, 28 PIC X(2)
USING WS-STATE SHADOWED BY
WS-STATE-SHAD. (1)
WORKING-STORAGE SECTION.
05 WS-STATE-SHAD PIC 9 COMP. (2)
Table 5-8. Corresponding Shadow Item Values and Bit Values
Shadow
Item
PIC 9
Shadow
Item
PIC X
Bit Pattern*
RETURN ENTER SELECT
0 space 0 0 0
1! 001
2"010
3#011
4$100
5%101
6&110
7 ' 1 1 1
* 0—Bit is off. 1—Bit is set.