The WRITE TERMINAL statement requests a synchronous or asynchronous data transfer from program variable storage to the terminal buffer.
►►─── WRITE TERMINAL ─┬──────────┬─┬─────────────────────────────┬────────────► ├─ WAIT ◄ ─┤ ├─┬─ NEWPAGE ─┬───────────────┤ └─ NOWAIT ─┘ │ └─ ERASE ───┘ │ └─┬─ EAU ───────────────────┬─┘ └─ ERASE ALL UNPROTECTED ─┘ ►─── FROM (output-data-location) ─┬─ TO (end-output-data-location) ─┬─ ; ────►◄ └─ LENGTH (output-data-length) ───┘
Indicates whether the write operation is to be synchronous or asynchronous.
Specifies that the write operation will be synchronous; the issuing task will automatically relinquish control to the system and wait for completion of the write operation before continuing processing. WAIT is the default.
Specifies that the write 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 section) 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.
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 area, or the length itself expressed as a numeric constant.
The following statement illustrates an asynchronous basic mode request to write data to the terminal from the specified location in program variable storage:
WRITE TERMINAL NOWAIT FROM (TERM_LINE) LENGTH (72);
Upon completion of the WRITE 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 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 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 output data area is zero or negative.
The terminal associated with the issuing task is out of service.
|
Copyright © 2014 CA.
All rights reserved.
|
|