The WRITE LINE TO TERMINAL statement transfers data from program variable storage to a terminal. WRITE LINE TO TERMINAL also establishes, modifies, and deletes page header lines.
Data transfers requested by WRITE LINE TO TERMINAL statements can be synchronous or asynchronous:
The transfer of a line to the buffer will result in a processing delay; however, control returns to the program immediately following the request. If the line of data fills the buffer, the entire page of data must be transmitted to the terminal. In this case, control does not return to the issuing program until the terminal operator responds by pressing ENTER. Thus, the program is made conversational.
With asynchronous requests, programs can buffer all required pages of output without suspending task execution during the actual transmission of data. However, the task can optionally terminate itself, thereby freeing resources and allowing the terminal operator to review the buffered output.
The system processes I/O requests in the sequence received from the task; thus, if a program issues a synchronous WRITE LINE TO TERMINAL request after issuing one or more asynchronous requests, the system will complete all I/O requests before returning control to the issuing program.
The WRITE LINE TO TERMINAL request issued automatically by the system to empty partially filled buffers upon completion of a task is synchronous; therefore, the terminal operator can view all screens and catch up with processing at that time. If an application allows the terminal operator to interrupt or terminate processing at some point within a task, a synchronous WRITE LINE TO TERMINAL request must be issued to suspend processing while awaiting an operator response.
►►─── WRITE LINE TO TERMINAL ─┬──────────┬─┬───────────┬─┬──────────────┬─────► ├─ WAIT ◄ ─┤ ├─ NEWPAGE ─┤ └─ NOBACKPAGE ─┘ └─ NOWAIT ─┘ └─ ERASE ───┘ ►─── FROM (output-data-location) ─┬─ TO (end-output-data-location) ─┬────────► └─ LENGTH (output-data-length) ───┘ ►─┬───────────────────────────────┬─ ; ──────────────────────────────────────►◄ └─ HEADER (header-line-number) ─┘
Specifies that the write operation is synchronous; the issuing task automatically relinquishes control and must wait for completion of the output operation before processing can continue. WAIT is the default.
Specifies that the write operation is asynchronous; the issuing task continues executing.
Writes the output data line beginning on a new page. For 3270-type devices, the NEWPAGE option forces the system to output the contents of the current buffer, even if the buffer is not full. The keywords NEWPAGE and ERASE are synonymous.
Specifies (for 3270-type devices only) that pages output in a scratch area are not to be kept. If NOBACKPAGE is specified, the terminal operator can view only the current page of output. NOBACKPAGE is valid only with the first I/O request in a line mode session.
Identifies the program variable-storage entry of the data to be transferred to the terminal device, or the page-header line being created, modified, or deleted. 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 program variable-storage entry that contains 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.
Defines the length, in bytes, of the output data area. Output-data-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.
Note: If the WRITE LINE TO TERMINAL statement is being used to delete a page-header line, output-data-length must be zero.
Specifies the number of the page header line being created, modified, or deleted. Header-line-number is either the symbolic name of a user-defined field that contains the header line number, or the header line number itself expressed as a numeric constant.
The following statement defines the value of a data area as a header to be displayed at the top of each new page written to the terminal:
WRITE LINE TO TERMINAL FROM (EMPL_HEAD) TO (END_EMPL_HEAD) HEADER (1);
The following statement writes the value in the specified data area to a new page on the terminal:
WRITE LINE TO TERMINAL NOWAIT NEWPAGE FROM (EMPL_RPT) LENGTH (60);
Upon completion of the WRITE LINE TO 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 occurred during processing.
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 output area is zero or negative.
The specified program variable-storage entry has not been allocated as required. A 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.
|
|