On Tue, Feb 3, 2009 at 5:49 PM, manish soni <pesfunk@xxxxxxxxx> wrote:
Hi,
I faced a critical issue today where one library in the End of Day jobs was
missing.
I was wondering if there is a way to add library to the current library list
of a batch job / Remote Job ?
Regards
Manish
--
You can execute a remote command in a batch job
with a Message Queue Break Program
PGM PARM(&MSGQ &MSGQLIB &MSGKEY)
DCL VAR(&MSGQ ) TYPE(*CHAR) LEN( 10)
DCL VAR(&MSGQLIB ) TYPE(*CHAR) LEN( 10)
DCL VAR(&MSGKEY ) TYPE(*CHAR) LEN( 4)
DCL VAR(&MSG ) TYPE(*CHAR) LEN( 78)
DCL VAR(&MSGLEN ) TYPE(*DEC ) LEN(15 5) VALUE(78)
MONMSG MSGID(CPF0000)
RCVMSG MSGQ(&MSGQLIB/&MSGQ) MSGKEY(&MSGKEY) RMV(*YES) MSG(&MSG)
SNDPGMMSG MSG(&MSG) TOPGMQ(*EXT) MSGTYPE(*RQS)
RCVMSG PGMQ(*EXT) MSGTYPE(*RQS) RMV(*NO)
CALL PGM(QCMDEXC) PARM(&MSG &MSGLEN)
ENDPGM
Have the batch job create a message queue, and then put that
message queue in break mode:
CHGMSGQ MSGQ(DEVCPANDO/A230539) DLVRY(*BREAK) PGM(DEVCPANDO/CP0004)
Any command string sent to the batch job will be executed (and, because
of what was done with *EXT and *RQS, logged to the job log).
SNDMSG MSG('addlible JDESRC73 *last') TOMSGQ(DEVCPANDO/A230539)
Resulting in a job log (I did this interactively) of:
> CHGMSGQ MSGQ(DEVCPANDO/A230539) DLVRY(*BREAK) PGM(DEVCPANDO/CP0004)
2 > addlible JDFSRC73 *last
Library JDFSRC73 added to library list.
The kindest thing I can think of to call this technique is an unnatural act.
A powerful debugging tool, no production code should use this. About all
I use message queue break progams for is to resend my completion messages
as status messages.
HTH,
Chris
P.S. If you alter your intitial program so that your interactive job
has a message queue
in break mode, you can get a command entry screen while input
inhibited. This can be
helpful.
--
As an Amazon Associate we earn from qualifying purchases.