TN3270 Server Manual

CRT Communication Protocol
TN3270 Server Manual424097-001
5-6
SETMODE Function 59 Procedure
SETMODE Function 59 Procedure
A SETMODE function 59 procedure returns the actual count of bytes read as a result of
a CONTROL 22 operation (two-step READ request) completion.
filenumber
INT:value
is the file to receive the SETMODE function.
59
INT:value
is the SETMODE number for obtaining the actual count of the bytes read.
last-params
INT .ref:2
is a value that must be provided. It returns:
last-params[0]
is the actual number of bytes read.
last-params[1]
is a 0 (zero).
The parameter positions normally used for param1 and param2 of the SETMODE
procedure are not used in a SETMODE 59 procedure. Do not provide these parameters.
If you do, Error 2 (invalid operation attempted) is returned. Error 26 is returned if the
subdevice has no outstanding two-step READ requests completed or if the SETMODE
requester is not the two-step READ requester.
Example
The following is an example of the application request sequence using a two-step READ
and a SETMODE 59:
CALL SETMODE (filenumber, 59, , , last-params);
CALL CONTROL (T1,22,500);
CALL AWAITIO (T1, ... );
posts a 500-byte READ to T1 and waits
for completion.
CALL SETMODE (T1,59,,,PARAMS);
the READ request has completed; it gets
the actual size.
CALL READ(T1,BUFFER,PARAMS[0]);
the READ request has completed with the
actual byte size instead of 500.