The READ LINE FROM TERMINAL statement requests a synchronous, line-by-line transfer of data from the terminal to the issuing program.
►►─── READ LINE FROM TERMINAL ─┬────────┬─┬──────────────┬────────────────────► └─ ECHO ─┘ └─ NOBACKPAGE ─┘ ►─ INTO (input-data-location) ┬ TO (end-input-data-location) ──────────────┬─► └ MAX LENGTH (input-data-location-max-length)┘ ►─┬─────────────────────────────────────────────────┬─ ; ────────────────────►◄ └─ RETURN LENGTH INTO (input-data-actual-length) ─┘
Requests (for 3270-type devices only) that the system to save the line of data being input in the current page (as displayed on the screen). If ECHO is not specified, data entered will not be retained and, therefore, will not be available for review by the terminal operator.
Requests (for 3270-type devices only) that the system not save previously input pages in a scratch area. If NOBACKPAGE is specified, the terminal operator can view only the current page of data. NOBACKPAGE is valid only with the first input request in a line mode session.
Indicates the program variable-storage entry reserved for the input data. Input-data-location is the symbolic name of a user-defined field. The length of the data area is determined by one of the following specifications:
Indicates the end of program variable storage 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 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.
If the input data stream is larger than the data area reserved in program variable storage, the system truncates the data 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 reads the specified data from a 3270-type device into the specified location in the program and echoes the input data on the screen:
READ LINE FROM TERMINAL ECHO INTO (EMPL_DATA) TO (END_EMPL_DATA);
The following statement reads the specified data into the program without saving pages associated with the line I/O session:
READ LINE FROM TERMINAL NOBACKPAGE INTO (EMPL_DATA) MAX LENGTH (8) RETURN LENGTH INTO (REC_DATA_LENGTH);
Upon completion of the READ LINE FROM TERMINAL function, the ERROR_STATUS field in the IDMS DC communications block indicates the outcome of the operation:
The request has been serviced successfully.
A logical or permanent I/O error has been encountered in the input data stream.
The input area specified for the return of data is too small; the returned data has been truncated to fit the available space.
The line request block (LRB) contains an invalid field, indicating a possible error in the program's parameters.
The derived length of the specified line input area is zero or negative.
The specified program variable-storage entry has not been allocated as required. A prior GET STORAGE request must be issued.
The line I/O session has been canceled; the terminal operator has pressed CLEAR (3270s), ATTENTION (2741s), or BREAK (teletypes).
|
Copyright © 2014 CA.
All rights reserved.
|
|