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-50
Field-Characteristic Clauses
screen-field are used as a prompt for the screen field described with the
PROMPT clause.
For terminals operating in conversational mode, screen-field is used as a signal
for input. In the Screen Section, a screen field description must precede the associated
PROMPT clause in the same screen description.
During execution of the ACCEPT statement, the value specified in the prompt screen
field is displayed before the terminal is able to receive input. The prompt value is
always displayed in the first column of a screen line.
The following example illustrates a PROMPT clause with screen-field described
in the Screen Section. When the associated ACCEPT statement executes, LAST NAME
appears on the screen followed by a set of parentheses (delimiting the field size) and the
cursor.
SCREEN SECTION .
01 ADDCUST-SCREEN BASE SIZE 24, 80 .
05 NAME1-PROMPT AT 3,2 VALUE "LAST NAME: " .
05 LAST-NAME-FIELD AT 3,13 PIC X(10) USING CUST-LAST-NAME
LENGTH MUST BE 1 THRU 10
PROMPT NAME1-PROMPT .
The next example illustrates a PROMPT clause with screen-field described in the
Working-Storage Section and output with a FROM clause.
WORKING-STORAGE SECTION.
O1 NEWCUST-REC.
05 NEW-LAST-NAME PIC X(10) VALUE SPACES.
:
01 WS-PROMPT-VALUE PIC X(11) VALUE "LAST NAME: ".
:
SCREEN SECTION.
01 NEWCUST-SCREEN.
05 LAST-NAME-PROMPT AT 3,2 PIC X(11) FROM WS-PROMPT-VALUE.
05 LAST-NAME-FIELD AT 3,13 PIC X(10) USING NEW-LAST-NAME
LENGTH MUST BE 1 THRU 10
PROMPT LAST-NAME-PROMPT.
The PROMPT clause displays a screen field with or without parentheses depending on
the screen-field definition.
If the screen field is defined with a FROM or USING phrase, the PROMPT clause
displays the value currently stored in the associated Working-Storage data item in
parentheses following the prompt. For example, if LAST NAME (Brown) appears,
Brown was the value entered during the last ACCEPT statement for this field.
If the screen field is defined with a TO phrase, the PROMPT clause does not display
parentheses.