The WRITE THEN READ TERMINAL statement requests a transfer of data from program variable storage to the terminal buffer and, when the terminal operator has completed entering data, a transfer of that data back to program variable storage.
►►─── WRITE ─┬────────┬─ READ TERMIMAL ─┬──────────┬──────────────────────────► └─ THEN ─┘ ├─ WAIT ◄ ─┤ └─ NOWAIT ─┘ ►─┬─────────────────────────────┬────────────────────────────────────────────► ├─┬─ NEWPAGE ─┬───────────────┤ │ └─ ERASE ───┘ │ └─┬─ EAU ───────────────────┬─┘ └─ ERASE ALL UNPROTECTED ─┘ ►─┬────────────────────────────────────────────────┬─────────────────────────► ├─ MODIFIED ─┬─ FROM POSITION (screen-position) ─┘ └─ BUFFER ───┘ ►─── FROM (output-data-location) ─┬─ TO (end-output-data-location) ─┬────────► └─ LENGTH (output-data-length) ───┘ ►─── INTO (input-data-location) ─┬─ TO (end-input-data-location) ───────┬────► └─ MAX LENGTH (input-data-max-length) ─┘ ►─┬─────────────────────────────────────────────────┬─ ; ────────────────────►◄ └─ RETURN LENGTH INTO (input-data-actual-length) ─┘
Indicates whether the I/O operation is to be synchronous or asynchronous.
Specifies that the I/O operation will be synchronous; the issuing task will automatically relinquish control to the system and must wait for completion of the I/O operation before processing can continue. WAIT is the default.
Specifies that the I/O operation will be asynchronous; the issuing task will continue executing.
Note: If NOWAIT is specified, the program must issue a CHECK TERMINAL request (described earlier in this chapter) before performing any other I/O operation.
Specifies the mechanism to be used with the write operation:
Activates the page-eject (SYSINOUT devices) or erase-write (3270-type devices) mechanism to erase the contents of a screen. If NEWPAGE is not specified, the WRITE TERMINAL request will write over rather than erase data displayed on the terminal. The keywords NEWPAGE and ERASE are synonymous.
Activates (for 3270-type devices only) the erase-all-unprotected mechanism. Following a WRITE TERMINAL EAU function, only protected fields remain on the terminal. If EAU is specified, the FROM clause (described below) need not be specified.
Transfers (for 3270-type devices only) data to the application program without requiring the terminal operator to signal completion of data entry.
Reads all modified fields in the terminal buffer into program variable storage.
Executes a READ BUFFER command that reads the entire contents of the terminal buffer into the program variable storage.
Defines the buffer address (screen position) at which the read will start. Screen-position is either the symbolic name of a user-defined FIXED BINARY(31) field or the address itself enclosed in quotation marks.
Specifies the program variable-storage entry of the output data stream. Output-data-location is the symbolic name of a user-defined field. The length of the output data stream is determined by one of the following specifications:
Indicates the end of the output data stream and is specified following the last data-item entry in output-data-location. End-output-data-location is the symbolic name of either a user-defined dummy byte field or a field that contains a data item not associated with the output data stream.
Defines the length, in bytes, of the output data stream. Output-data-length is either the symbolic name of a user-defined field that contains the length of the data stream, or the length itself expressed as a numeric constant.
Specifies the program variable-storage entry of the data area reserved for the input data stream. Input-data-location is the symbolic name of a user-defined field. The length of the input data stream is determined by one of the following specifications:
Indicates the end of the data area reserved for the input data stream and is specified following the last data-item entry in input-data-location. End-input-data-location is the symbolic name of either a user-defined dummy byte field or a field that contains a data item not associated with the data area reserved for the input data stream.
Defines the length, in bytes, of the data area reserved for the input data stream. Input-data-max-length is either the symbolic name of a user-defined field that contains the length of the data stream, or the length itself expressed as a numeric constant.
If the input data stream is larger than the data area reserved in program variable storage, the system truncates the data stream to fit the available space.
Indicates the location to which the system will return the actual length of the input data stream. Input-data-actual-length is the symbolic name of a user-defined field. If the data stream has been truncated, input-data-actual-length contains the original length before truncation.
The following statement illustrates a basic mode request to write data from the program (OUTPUT_LINE) to the terminal, read the data from the terminal to the specified location (INPUT_LINE) in the program, and return the actual length of the input data stream (LINE_LENGTH) to variable storage:
WRITE THEN READ TERMINAL WAIT FROM (OUTPUT_LINE) TO (END_INPUT_LINE) INTO (INPUT_LINE) MAX LENGTH (80) RETURN LENGTH INTO (LINE_LENGTH);
Upon completion of the WRITE THEN READ TERMINAL function, the ERROR_STATUS field in the IDMS DC communications block indicates the outcome of the operation:
The request has been serviced successfully.
The input area specified for the return of data is too small; the returned data has been truncated to fit the available space.
The output operation has been interrupted; the terminal operator has pressed ATTENTION or BREAK.
A logical error (for Example, an invalid control character) has been encountered in the output data stream.
A permanent I/O error has occurred.
4528
The dial-up line for the terminal has been disconnected.
The terminal request block (TRB) contains an invalid field, indicating a possible error in the program's parameters.
The derived length of the specified I/O data area is zero or negative.
Storage for the input buffer cannot be acquired because the specified program variable-storage entry has been allocated.
The specified program variable-storage entry has not been allocated and the GET STORAGE option has not been specified.
The terminal device associated with the issuing task is out of service.
|
Copyright © 2014 CA.
All rights reserved.
|
|