Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-14
ACCEPT Statement
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.
The CLEAR INPUT statement resets the MDT bits and displays null values in all
unprotected fields of the screens currently displayed. RESET ATTR or TURN
MDTOFF can be used instead if blanking out the input fields is not desired.
You must consider another MDT convention: the TCP turns a field’s MDT bit on in the
following operations:
When a TURN TEMP statement selects an input field for changing display
attributes, the MDT bit is always set.
When a RESET TEMP statement selects an input field for resetting display
attributes, the MDT bit is set, regardless of the initial MDT attribute of the field.