× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.