$FunWait: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (misc cleanup)
 
(8 intermediate revisions by 4 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Wait until asynchronous Fast/Unload request completes</span>
<span class="pageSubtitle">Wait until asynchronous Fast/Unload request completes</span>


This requests that the user wait until an asynchronous ''[[Fast/Unload]]'' request is completed.  
This requests that the user wait until an asynchronous <var class="product">[[Fast/Unload]]</var> request is completed.  


The <var>$FunWait</var> function accepts one argument and returns a numeric result.  
The <var>$FunWait</var> function accepts one argument and returns a numeric result.  
==Syntax==
<p class="syntax"><span class="term">%result</span> = <span class="literal">$FunWait</span>(<span class="term">req_num</span>)
</p>


The only argument is a string that identifies the request number to be waited on. To wait on a request, the user must have initiated the request.  
The only argument is a string that identifies the request number to be waited on. To wait on a request, the user must have initiated the request.  
<p>
<var class="term">%result</var> is set to either of these: </p>
<ul>
<li>The return code from <var class="product">Fast/Unload</var></li>


In the following example, two ASYNCH ''[[Fast/Unload]]'' requests are placed and then their completion is waited for. If FUNTSKN is 2 or greater, these requests can run in parallel.
<li>-1, if the request cannot be found </li>
<p class="code"> %RNUM1 = $FunLoad('DATA1',..,'ASYNC')
</ul>
IF %RNUM1 < 0 THEN
 
==Example==
In the following example, two ASYNCH <var class="product">Fast/Unload</var> requests are placed, then their completion is waited for. If <var>[[FUNTSKN parameter|FUNTSKN]]</var> is 2 or greater, these requests can run in parallel.
<p class="code">%RNUM1 = $FunLoad('DATA1',..,'ASYNC')
IF %RNUM1 < 0 THEN
  JUMP TO FUNERR
  JUMP TO FUNERR
END IF
END IF
   
   
%RNUM2 = $FunLoad('DATA2',..,'ASYNC')
%RNUM2 = $FunLoad('DATA2',..,'ASYNC')
  IF %RNUM2 < 0 THEN
  IF %RNUM2 < 0 THEN
%RC = $FunPurg(%RNUM1)
  %RC = $FunPurg(%RNUM1)
JUMP TO FUNERR
  JUMP TO FUNERR
END IF
%RC1 = $FunWait(%RNUM1)
%RC2 = $FunWait(%RNUM2)
  END IF
  END IF
   
   
%RC1 = $FunWait(%RNUM1)
%RC2 = $FunWait(%RNUM2)
</p>
</p>


==Syntax==
==Products authorizing {{PAGENAMEE}}==
<p class="syntax"><section begin="syntax" />%result = $FunWait(req_num)
<ul>
<section end="syntax" /></p>
<li>[[Fast/Unload SOUL Interface]]
<p>
</p>
<p>%result is set to the return code from [[Fast/Unload]], or it is set to -1 if the request cannot be found.</p>
<p class="code">
-1 - request not found
</p>
<p class="caption">$FunWait Error Codes
</p>
 
<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList">
<li>[[Fast/Unload User Language Interface]]
</ul>
</ul>
<p>
</p>


[[Category:$Functions|$FunWait]]
[[Category:$Functions|$FunWait]]
[[Category:Fast/Unload User Language Interface]]
[[Category:Fast/Unload SOUL Interface]]

Latest revision as of 20:43, 16 March 2015

Wait until asynchronous Fast/Unload request completes

This requests that the user wait until an asynchronous Fast/Unload request is completed.

The $FunWait function accepts one argument and returns a numeric result.

Syntax

%result = $FunWait(req_num)

The only argument is a string that identifies the request number to be waited on. To wait on a request, the user must have initiated the request.

%result is set to either of these:

  • The return code from Fast/Unload
  • -1, if the request cannot be found

Example

In the following example, two ASYNCH Fast/Unload requests are placed, then their completion is waited for. If FUNTSKN is 2 or greater, these requests can run in parallel.

%RNUM1 = $FunLoad('DATA1',..,'ASYNC') IF %RNUM1 < 0 THEN JUMP TO FUNERR END IF %RNUM2 = $FunLoad('DATA2',..,'ASYNC') IF %RNUM2 < 0 THEN %RC = $FunPurg(%RNUM1) JUMP TO FUNERR END IF %RC1 = $FunWait(%RNUM1) %RC2 = $FunWait(%RNUM2)

Products authorizing $FunWait