Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
6-123
SET Statement
terminals, the cursor position is at the first field of the ACCEPT statement defined with
a TO or USING clause.
If you do not want the cursor positioned at a protected field on an IBM3270 terminal,
you can use a SET statement to position the cursor at an unprotected field.
The DEPENDING ON clause for the SET statement is analogous to the DEPENDING
ON clause for the PERFORM ONE statement. The following example illustrates this.
WORKING-STORAGE SECTION.
:
77 ws-screen-status PIC 9(4) COMP VALUE 1.
01 ws-fld1 PIC x(10).
01 ws-fld2 PIC x(10).
01 ws-fld3 PIC x(10).
SCREEN SECTION.
:
01 MENU1 SIZE 24, 80.
05 screen-fld1 at 4, 20
PIC X(10)
from fld1.
05 screen-fld2 at 5, 40
PIC X(10)
from fld2.
05 screen-fld3 at 6, 60
PIC X(10)
from fld3.
PROCEDURE DIVISION.
:
BODY-PARAGRAPH.
:
DISPLAY BASE MENU1.
DISPLAY MENU1.
SET NEW-CURSOR AT SCREEN-FLD1,
SCREEN-FLD2,
SCREEN-FLD3,
DEPENDING ON WS-SCREEN-STATUS.
ACCEPT MENU1
:
If WS-SCREEN-STATUS equals 1, the cursor is positioned at SCREEN-FLD1 upon
execution of the ACCEPT statement. If WS-SCREEN-STATUS equals 2, the cursor is
positioned at SCREEN-FLD2 upon execution of the ACCEPT statement, and so on. It
is not considered erroneous if WS-SCREEN-STATUS < 1 or
WS-SCREEN-STATUS > 3. Control just falls through (execution continues with the
next statement) and the cursor is left at its default position.










