ibm-information-center/dist/eclipse/plugins/i5OS.ic.cl_5.4.0.1/wait.htm

173 lines
7.0 KiB
HTML

<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Wait (WAIT)</title>
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body bgcolor="white">
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<a name="WAIT.Top_Of_Page"></a>
<h2>Wait (WAIT)</h2>
<table width="100%">
<tr>
<td valign="top" align="left"><b>Where allowed to run: </b>
<ul><li>Batch program (*BPGM)</li>
<li>Interactive program (*IPGM)</li>
</ul><b>Threadsafe: </b>No
</td>
<td valign="top" align="right">
<a href="#WAIT.PARAMETERS.TABLE">Parameters</a><br>
<a href="#WAIT.COMMAND.EXAMPLES">Examples</a><br>
<a href="#WAIT.ERROR.MESSAGES">Error messages</a></td>
</tr>
</table>
<div> <a name="WAIT"></a>
<p>The Wait (WAIT) command accepts input from any display device from which user data is requested by one or more previous Receive File (RCVF), Send File (SNDF), or Send/Receive File (SNDRCVF) commands that do not wait to receive the input data. Those commands had *NO specified in the WAIT parameter or, in the case of SNDF, had the INVITE DDS keyword option specified in the record format sent to the display, and specified a particular device file to receive and transfer the data to the CL procedure. Only one input request per device can be outstanding at any given time. If there are multiple outstanding input requests, the user data of the first device to respond to the specified device file is sent to the CL procedure. If the data is received within the wait interval, the Wait operation ends and the next command in the program is processed. Otherwise an escape message is sent to the CL procedure.
</p>
<p>The program waits the number of seconds specified for the WAITRCD keyword of the Create Display File (CRTDSPF), Change Display File (CHGDSPF), or Override with Display File (OVRDSPF) commands for a device to respond to an input request.
</p>
<p><b>Restrictions:</b>
</p>
<ul>
<li>This command is valid only for display files within a CL procedure. It cannot be used with database files.
</li>
</ul>
</div>
<table width="100%">
<tr><td align="right"><a href="#WAIT.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div>
<h3><a name="WAIT.PARAMETERS.TABLE">Parameters</a></h3>
<table border="1" cellpadding="4" cellspacing="0">
<!-- col1="10" col2="15" col3="30" col4="10" -->
<tr>
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
</tr>
<tr>
<td valign="top"><a href="#WAIT.DEV"><b>DEV</b></a></td>
<td valign="top">CL var for responding device</td>
<td valign="top"><i>CL variable name</i>, <b><u>*NONE</u></b></td>
<td valign="top">Optional, Positional 1</td>
</tr>
<tr>
<td valign="top"><a href="#WAIT.OPNID"><b>OPNID</b></a></td>
<td valign="top">Open file identifier</td>
<td valign="top"><i>Simple name</i>, <b><u>*NONE</u></b></td>
<td valign="top">Optional</td>
</tr>
</table>
<table width="100%">
<tr><td align="right"><a href="#WAIT.Top_Of_Page">Top</a></td></tr>
</table>
</div>
<div> <a name="WAIT.DEV"></a>
<h3>CL var for responding device (DEV)</h3>
<p>Specifies the name of the CL variable that receives the name of the display device that responds with user data for the CL procedure.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No CL variable name is specified; the name of the responding device is not needed.
</dd>
<dt><b><i>name</i></b></dt>
<dd>Specify the name of the CL variable that receives the name of the responding device. A device name cannot be specified.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#WAIT.Top_Of_Page">Top</a></td></tr>
</table>
<div> <a name="WAIT.OPNID"></a>
<h3>Open file identifier (OPNID)</h3>
<p>Specifies the open file identifier that was declared on a preceding Declare File (DCLF) command in the same CL procedure. A CL variable cannot be specified for this parameter value.
</p>
<dl>
<dt><b><u>*NONE</u></b></dt>
<dd>No open file identifier is provided. This command will use the file associated with the DCLF command that had *NONE specified for the OPNID parameter. Only one file can be declared in a CL procedure with *NONE as the open file identifier.
</dd>
<dt><b><i>simple-name</i></b></dt>
<dd>Specify a name that matches the OPNID parameter value on a preceding DCLF command in the same CL procedure.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#WAIT.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="WAIT.COMMAND.EXAMPLES">Examples</a> </h3>
<p><b>Example 1: Receiving User Data</b>
</p>
<p>
<pre>
DCLF FILE(MSCREEN)
:
RCVF DEV(DEV1) WAIT(*NO)
:
RCVF DEV(DEV2) WAIT(*NO)
:
WAIT DEV(&amp;DEVNAM)
</pre>
</p>
<p>In this example, the device file MSCREEN is used to receive user data. The RCVF commands specify that the procedure does not wait for the data. The WAIT command causes the procedure to wait for the display device file MSCREEN to pass input data to it from one of its devices. The name of the responding display device is placed in the CL variable &amp;DEVNAM. The received data is placed in the CL variables associated with the record format of the declared file.
</p>
<p><b>Example 2: Receiving Data Using Open File Identifier</b>
</p>
<p>
<pre>
DCLF FILE(DF1) RCDFMT(FMT1) OPNID(DSPF1)
:
RCVF DEV(DEV1) OPNID(DSPF1) WAIT(*NO)
:
WAIT DEV(*NONE) OPNID(DSPF1)
</pre>
</p>
<p>In this example, the RCVF command specifies to use the display file associated with open file identifier DSPF1, namely DF1. The procedure does not wait for user data. When the WAIT command is issued with the same open file identifier, the data received is placed in the CL variables declared for record format FMT1 of display file DF1. The name of the responding device is not returned into a CL variable.
</p>
</div>
<table width="100%">
<tr><td align="right"><a href="#WAIT.Top_Of_Page">Top</a></td></tr>
</table>
<hr size="2" width="100%">
<div><h3><a name="WAIT.ERROR.MESSAGES">Error messages</a> </h3>
<p><b><u>*ESCAPE Messages</u></b>
</p>
<dl>
<dt><b>CPF0859</b></dt>
<dd>File override caused I/O buffer size to be exceeded.
</dd>
<dt><b>CPF0882</b></dt>
<dd>No corresponding RCVF or SNDRCVF command for WAIT command.
</dd>
<dt><b>CPF0886</b></dt>
<dd>Record contains a data field that is not valid.
</dd>
<dt><b>CPF0888</b></dt>
<dd>Command not run because job being ended.
</dd>
<dt><b>CPF0889</b></dt>
<dd>No data available for input request within specified time.
</dd>
<dt><b>CPF4101</b></dt>
<dd>File &amp;2 in library &amp;3 not found or inline data file missing.
</dd>
<dt><b>CPF5068</b></dt>
<dd>Program device &amp;4 not found in file &amp;2 in library &amp;3.
</dd>
<dt><b>CPF5070</b></dt>
<dd>File &amp;2 in library &amp;3 has no program devices acquired.
</dd>
</dl>
</div>
<table width="100%">
<tr><td align="right"><a href="#WAIT.Top_Of_Page">Top</a></td></tr>
</table>
</body>
</html>