Indicates whether the data stream just received would unlock the keyboard if sent to the terminal.
When a script procedure receives a data stream from the PLU (application), it should not attempt to automatically reply until a data stream is received that would unlock the keyboard if sent to the terminal. Failure to wait for the unlock condition could result in the reply being discarded because the SNA session state does not allow data to be sent.
&MAIUNLCK returns one of the following values:
Indicates that the data stream would unlock the keyboard.
Indicates that the data stream would not unlock the keyboard.
Example: &MAIUNLCK
&IF &MAIUNLCK = NO &THEN &GOSUB .WAITUNLCK
Notes:
&MAIUNLCK is normally used to determine if a reply is returned to the application. MAI delivers to the procedure each data stream as it is received. The script procedure might decide(using &MAIFIND) that it is time to reply to the application. However, some applications send data to the screen in multiple I/O operations, only unlocking the keyboard on the last one. A good example of such an application is TSO.
During logon, TSO sends 'logon in progress' type messages, followed by any broadcast messages, and finally the READY prompt. Multiple I/O operations is performed to send these messages, and the script procedure sees each one as it occurs. Even the READY prompt cannot actually unlock the keyboard. It could be followed by another data stream that contains the data necessary to unlock the keyboard.
A script procedure which wanted to reply after the READY prompt would find the prompt using &MAIFIND, but might still not be able to reply unless the prompt also unlocked the keyboard. If &MAIUNLCK returned NO on the READY data stream, the procedure would have to wait for the next data stream to unlock the keyboard before replying.
Most applications are far easier to handle than this. Usually one I/O operation is used to send data to the screen, and that data stream also unlocks the keyboard.
An &MAIUNLCK issued when there is no data outstanding returns a null value. Data is outstanding from the time an &MAIREAD is satisfied until an &MAICONT, &MAIDEL, or another &MAIREAD is issued. &MAIUNLCK issued while processing an SLU data stream returns the value NO.
Note: For more information, see the examples in the BASE.INSTALL library.
| Copyright © 2009 CA. All rights reserved. |
|