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

Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
6-13
ACCEPT Statement
during an ACCEPT operation, the key has the same effect as entering the abort input-
control characters.
The following example illustrates an ACCEPT statement for conversational mode. The
value of TERMINATION-STATUS is 1 if valid input is entered, 2 for ABORT, and 2
for TIMEOUT.
ACCEPT EMPLOYEE-SCREEN UNTIL INPUT
ESCAPE ON (ABORT, TIMEOUT 180).
PERFORM ONE OF
300-CHECK-NULL-NAME
200-EXIT-ROUTINE
DEPENDING ON TERMINATION-STATUS.
Modified Data Tag (MDT)
There is a modified data tag (MDT) associated with each nonliteral screen field. The
MDT is a 1-bit field that indicates whether data in the screen field has been modified
and, therefore, should be transmitted to the TCP upon completion of the ACCEPT
statement. The terminal sends data only for fields with MDT set on. If the screen field
has not been modified, MDT is not set and data in the screen field is not transmitted to
the TCP.
You can manipulate the MDT bit programmatically. In SCREEN COBOL, the field
attributes MDTON and MDTOFF also control field data transmission. The application
programmer has a choice of having the data in a screen field transmitted in either of the
following circumstances:
Unconditionally upon every ACCEPT statement (MDTON)
When the screen field has been modified (MDTOFF)
The field’s MDT bit is not reset after the completion of an ACCEPT statement. Once
the MDT bit is set, it stays set until the next DISPLAY BASE, TURN, RESET, or
CLEAR INPUT operation. Repeated ACCEPT statements, without any of these
operations in between the statements, cause previously sent data to be retransmitted.
Although retransmission of data might be desirable for some applications, you can
programmatically avoid resending it if you wish.
The following example illustrates the recommended use of the CLEAR INPUT verb if
you do not want retransmission of terminal data.
START-PROGRAM.
DISPLAY BASE screen-id.
LOOP.
DISPLAY screen-id.
ACCEPT screen-id UNTIL F1-KEY
ESCAPE ON SF16-KEY.
.
.
.
CLEAR INPUT.
GO TO LOOP.