Read from Virtual Terminal (QTVRDVT) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Read from Virtual Terminal (QTVRDVT) API reads data from the virtual terminal into the server program's data buffer. Your application should read data only if it has received an asynchronous notification message on the data queue, or if the more data flag was set on a previous read operation. The data received is in 5250 data stream format.

Only one full-screen display of data can be received at a time. If the data buffer is too small, partial displays are received and the more data flag for the QTVRDVT API's read information parameter is set to 1.

Before working with 5250 data streams, be sure to see the IBM® 5494 Functions Reference manual, SC30-3533. This manual can be viewed online through the IBM Publications CenterLink outside information center.


Authorities and Locks

None.


Required Parameter Group

Virtual terminal handle
INPUT; CHAR(16)

The reference code for the open virtual terminal path, created by the operating system with the Open Virtual Terminal Path (QTVOPNVT) API.

Read information
OUTPUT; CHAR(10)

Information about the read operation. The characters and their meanings are:


Data buffer
OUTPUT; CHAR(*)

The server program's buffer for receiving data from the virtual terminal. The data is a 5250 data stream.

The QTVRDVT API does not lock the data buffer. Thus, other applications should not use the buffer while the API is using it.

The data buffer should be large enough to hold the largest display of data expected. If it is not large enough for all the data to fit, the more data flag of the read information parameter is set to 1. Additional read requests must be performed, until all the remaining data is received and the more data flag is set back to 0.

Number of bytes to read
INPUT; BINARY(4)

The number of bytes to read from the data buffer. This number must be smaller than or equal to the size of the data buffer.

Data received
OUTPUT; BINARY(4)

The amount of data received from the virtual terminal in bytes. If no data is received from the virtual terminal, 0 is returned. Some read operations do not return any data.

For graphic work stations, a maximum of 24 576 (24KB) bytes of data can be returned.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Read Operation Codes

The following table describes the operation codes that can be returned on a read request.



Error Messages



API introduced: V2R1

[ Back to top | Virtual Terminal APIs | APIs by category ]