40 pts.
 Change AS/400 Library List for a Batch Job
HI, Is there a way by which we can override the Library List for a batch job, when the job is active?

Software/Hardware used:
ASKED: March 6, 2009  9:48 AM
UPDATED: March 11, 2009  8:35 AM

Answer Wiki:
Yes, by commands in the batch job such as ADDLIBLE or RMBLIBLE. But I don't think that's what you wanted. Perhaps someone knows how a user can do this? Perhaps as part of debugging a batch job? Phil Hi, I don't think it's possible - not even using STRSRVJOB. Regards, Martin Gilbert. Not sure if this helps, but if you're looking at restoring the library list after the job is finished, this is what I do: 1st, declare a variable to hold existing library list 0025.00 DCL VAR(&USRLIBL) TYPE(*CHAR) LEN(2750) Then go out and grab the existing list 0036.00 RTVJOBA USRLIBL(&USRLIBL) Adjust the running library list as you see fit 0088.00 ADDLIBLE LIB(YOURLIB) POSITION(*LAST) Finally, restore the library list to the saved list when the job is finished however, note that RTNLIBL is a TAATOOL............ 0092.00 RTNLIBL USRLIBL(&USRLIBL) Regards, Bob Strause
Last Wiki Answer Submitted:  March 9, 2009  6:08 pm  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts. , philpl1jb   44,180 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I HAVE NOT TRIED IT BUT YOU MAY BE ABLE TO
CALL ‘QCMDEXC’
WITH APROPRIATE ADDLIBLE /RMVLIBLE COMMANDS FROM WITHIN RPGLE AT DESIRED PLACE.
IT WILL WORK WITH FILE AND PRINTER OVER RIDES. SO MAYBE—–

 1,000 pts.

 

Lots of guesswork about the question here.

Please state whether you want to alter the library list for the job, using instructions within the jobs own JCL, or whether you intend to alter the library list for an executing job, externally to the job.

I really don’t see how the latter can work. If you have to wait for the job to be active, then alter the library list, you will have to arrange some sort of pause, or it will be quicker than you are.
If you have to embed a pause in the JCL to wait for the library list change, then you should embed the logic to determine the library list, and change it.

I suggest you take a look at the CL Programming manuals in the concepts section. The answer’s always in the books.

 5,505 pts.