The READ TERMINAL statement requests a synchronous or asynchronous basic mode data transfer from the terminal to program variable storage.
►►─── READ TERMINAL ─┬──────────┬─────────────────────────────────────────────► ├─ WAIT ◄ ─┤ └─ NOWAIT ─┘ ►─┬──────────────────────────────────────────────────┬───────────────────────► └─┬─ MODIFIED ─┬─ FROM POSITION (screen-position) ─┘ └─ BUFFER ───┘ ►── INTO (input-data-location) ─┬─ TO (end-input-data-location) ───────┬─────► └─ MAX LENGTH (input-data-max-length) ─┘ ►─┬─────────────────────────────────────────────────┬─ ; ────────────────────►◄ └─ RETURN LENGTH INTO (input-data-actual-length) ─┘
Specifies that the read operation will be synchronous; the issuing task will automatically relinquish control to the system and must wait for completion of the read operation before processing can continue. WAIT is the default.
Specifies that the read operation will be asynchronous; the issuing task will continue executing.
Note: If NOWAIT is specified, the program must issue a CHECK TERMINAL request (described later in this chapter) before performing any other I/O operations.
Requests (for 3270-type devices only) that the system transfer 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 variable storage.
Executes a READ BUFFER command that reads the entire contents of the terminal buffer into 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 single quotation marks.
Specifies the data area reserved for the input data stream. This parameter is not specified for asynchronous requests that use the CHECK TERMINAL statement to allocate storage for the input buffer. Input-data-location is the symbolic name of a user-defined field.
If the input data stream is larger than the specified data area, the system truncates the data to fit the available space.
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 area, or the length itself expressed as a numeric constant.
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 read data from the terminal to the specified location in variable storage:
READ TERMINAL WAIT INTO (TERM_LINE) TO (END_TERM_LINE);
Upon completion of the 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 to the issuing program is too small; the returned data has been truncated to fit the available space.
A permanent I/O error has occurred during processing.
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 input data area is zero or negative.
Storage for the input buffer cannot be acquired because the specified program variable-storage entry has been previously allocated; no I/O has been performed.
The terminal device associated with the issuing task is out of service.
|
Copyright © 2014 CA.
All rights reserved.
|
|