| &PARAMETERS | Parameters needed for the execution of the procedure. Looks like: input ip1, input ip2, output tqx |
| &PROCEDURE | The procedure that has to be executed. |
| &QUERY-PROC | name of the query program |
| &QUERY-VAR | handle variable to run the query procedure persistently |
assign viFcQueryReturn = 0.
if hQ{&QUERY-VAR} = ?
then do:
assign vhFcComponent = dataset tq{&QUERY-VAR}:handle.
run {&QUERY-PROC} persistent set hQ{&QUERY-VAR}.
run InitQuery in hQ{&QUERY-VAR}
(input viSessionId,
input vlFcStateless,
input vhFcComponent,
output viFcIncludeReturn).
if viFcIncludeReturn < 0
then do:
assign oiReturnStatus = viFcIncludeReturn.
delete procedure hQ{&QUERY-VAR}.
assign hQ{&QUERY-VAR} = ?.
return ?.
end.
end.
run {&PROCEDURE} in hQ{&QUERY-VAR} ({&PARAMETERS}).
if viFcQueryReturn < 0
then do:
assign oiReturnStatus = viFcQueryReturn.
return ?.
end.