Previous Topic: &MAICMD

Next Topic: &MAICURSA


&MAICONT

Sends the current data stream to the terminal and/or the application.

&MAICONT [ CONT | PLU | SLU | BOTH ]
         [ VIEW={ WAIT | OPT } ]

Requests that the current data streams be sent on to one or other or both of the PLU (application) or SLU (terminal).

Operands:

CONT

Indicates that the data stream should flow in the current direction.

If the last data stream received via &MAIREAD was received from the PLU, that data stream is forwarded to the SLU. If the last data stream was received from the SLU, that data stream (or one built up using &MAIPUT or modified using &MAIINKEY) is forwarded to the PLU.

PLU

Indicates that the data stream should be sent to the PLU. If the last data stream received via &MAIREAD was received from the SLU, that data stream (or one built up using &MAIPUT or modified using &MAIINKEY) is forwarded to the PLU. If the last data stream was received from the PLU, one or more &MAIPUT statements must have been issued to build up a data stream, which is then sent back to the PLU, otherwise the statement is ignored.

SLU

Indicates that the data stream should be sent to the SLU (terminal). The last data stream received via &MAIREAD must have been received from the PLU (application); otherwise the statement is ignored.

BOTH

Applies if the last data stream received via &MAIREAD was from the PLU, and indicates that the data stream should be sent to the SLU, and that a data stream built up using one or more &MAIPUT statements is to be sent to the PLU.

If no &MAIPUTs have been issued, &MAICONT BOTH functions like &MAICONT SLU. If the last data stream received was from the SLU, &MAICONT BOTH functions like &MAICONT PLU.

VIEW=WAIT

Indicates that data sent to the SLU must be displayed before the procedure resumes. The session cannot have screen ownership at the time the &MAICONT is issued-the user could be viewing another MAI session. VIEW=WAIT suspends execution of the procedure until the user jumps back to this session.

VIEW=OPT

Indicates that data sent to the SLU (terminal) is to be displayed.

At the time when the &MAICONT is issued, the session cannot have screen ownership, as the user might be viewing another MAI session. In this case, VIEW=OPT results in the data stream being discarded, and never being displayed at the terminal. However, if the session does own the screen at the time &MAICONT is issued, the data is displayed normally.

Examples: &MAICONT

&MAICONT BOTH VIEW=OPT 
&MAICONT 
&MAICONT SLU VIEW=WAIT

Notes:

If no &MAICONT is issued between two successive &MAIREAD statements, an &MAICONT CONT VIEW=OPT is implied.

An &MAICONT issued when there is no data outstanding is normally ignored. Data is outstanding from the time an &MAIREAD is satisfied until an &MAICONT, &MAIDEL or another &MAIREAD is issued. However, in the case of a script procedure started using a .S session skip command or session cleanup, an &MAICONT PLU is allowed before the first &MAIREAD. An &MAICONT PLU is also allowed after the time interval specified on an &MAIREAD WAIT= verb expires.

An &MAICONT that requests data to be sent to the PLU is ignored if the current session state does not allow input. For example, if the keyboard of an SNA terminal is locked. Such an &MAICONT should not be issued unless the procedure knows the &MAICONT will be successful. The &MAIUNLCK system variable is provided so that the procedure can wait for a data stream that unlocks the keyboard if necessary.

An &MAICONT PLU is often used to automatically reply to the application. For example, if the application prompts for a user ID, the script procedure can set up a reply data stream using &MAIPUTs, and then send that reply using &MAICONT PLU. Alternatively, an &MAICONT BOTH could be used. This would send the reply just as &MAICONT PLU does, but also send the prompt from the application on to the terminal. In this way, the terminal user sees the output from the application as it occurs. The VIEW operand governs whether the procedure proceeds even if the user is viewing a different session.

With certain applications some care must be taken to ensure screen image integrity. Take the ISPF product as an example. ISPF usually only sends data to the terminal that has changed since the last send. If a script procedure does not send each output from ISPF on to the terminal, an eventual send could result in only a partial screen image. This problem is solved by using the VIEW=WAIT option to ensure that each data stream is sent to the terminal. Alternatively, if output is not to be sent to the terminal, the procedure can request to show the complete screen image again. Using ISPF, this would be accomplished by pressing the PA2 key (using &MAIINKEY and &MAIPUT), and then sending the resulting complete screen image on to the terminal.

If the script procedure has issued an &PANEL statement without a subsequent &PANELEND, then either an explicit or implicit &MAICONT SLU will result in an &PANELEND to allow the data to be sent to the terminal. This does not apply if VIEW=OPT is coded.

More information:

&MAIPUT

&MAIINKEY

&MAIREAD