RUNQRY QRY(LIB/QUERY1)
how do I change it to
RUNQRY QRY(LIB/QUERY1) and RUNQRY QRY(LIB/QUERY2)
is there a way to seperate them i tried commas, semi colon, etc but
nothing seems to work. is there not a way to run multiple commands in
one statement?
You would have to create a seperate job entry or have 1 job entry to
call a program which will hold the 2 runqry statements.
On Aug 20, 9:44 am, lcollin...@hotmail.com wrote:
Note that CALL is also "an actual IBM command" :)
===> DSPOBJD OBJ(QSYS/CALL) OBJTYPE(*CMD) DETAIL(*SERVICE)
Licensed program . . . . . . . . . . : 5761SS1 V6R1M0
Another option for grouping commands is SBMDBJOB, but that would run the
commands in a different (batch) job. A CL program also provides
capabilities like better error handling, etc.
--
Karl Hanson
I believe that QSHell may be the easiest way to issue the two
separate requests via just one request to the QSH command requested as
the one CMD() for the scheduled task on ADDJOBSCDE. Refer to the
utility named 'system' which enables a "Run CL command" function.
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/rzahz/rzahz.pdf
Something like the following for example may suffice; not tested, nor
syntax verified:
QSH CMD('system -nqvsK "RUNQRY LIB/QRY1"; system -nqvsK "RUNQRY
LIB/QRY2";')
Command list activity can be more sophisticated than what the
semicolon provides, but the ';' character provides serial and
synchronous requests.
If that were not an option, e.g. if the option giving that feature is
not available, then:
I am not aware of any system-supplied CL command processor that takes
a string of delimited commands as input from a parameter. The easiest
program to write that could do so, would probably be a REXX program that
assumes non-escaped semicolons as command delimiter. Then the STRREXPRC
can be the command invocation used for the scheduled request, with the
first parameter being parsed as the delimited command requests. The
biggest issue is how to handle errors; typical for scheduled requests,
ensuring dependencies are met across multiple requests.
Neither of the following rexx sources are verified to be correct for
syntax nor even functional. Nor have the sample STRREXPRC invocations
[that follow each code sample] been tested. They should give an idea of
how easy it can be; at least given command strings without apostrophes.
<code>
/* rexx source: DoCmds */
parse arg CmdLst
address "*COMMAND"
signal on error
CmdNbr=0 /* CmdNbr assignments & .CmdNbr stems are optional */
Do while CmdLst^=""
CmdNbr=CmdNbr+1
parse var CmdLst CmdStr.CmdNbr";"CmdLst
CmdStr.CmdNbr /* pass request to *COMMAND */
End
exit
error: say CmdStr.CmdNbr" failed."; exit 99
</code>
strrexprc DoCmds parm('RUNQRY QRY(LIB/QUERY1); RUNQRY QRY(LIB/QUERY2)')
<code>
/* rexx source: DoCmdsI */
parse arg CmdLst /* valid REXX and/or CL requests */
address "*COMMAND"
signal on error
interpret CmdLst /* interpret delimited requests */
error: exit 99
</code>
strrexprc DoCmdsI parm('"RUNQRY QRY(LIB/QUERY1)";"RUNQRY
QRY(LIB/QUERY2)";')
strrexprc DoCmdsI parm('Q1="QUERY1"; Q2="QUERY2"; "RUNQRY
QRY(LIB/"Q1")";"RUNQRY QRY(LIB/"Q2")";')
Regards, Chuck
I would handle this with a single CL program
basically, with 2 commands in the program
SBMJOB CMD(RUNQRY.........)......
Schedule the CL program, it will then spawn off the 2 queries to the
jobq of your choice or the default queue. This accomplishes what you
want, having the 2 queries run with a single job.
Want more, email me