Change AS/400 Library List for a Batch Job

40 pts.
Tags:
AS/400 batch jobs
AS/400 Library
RPG
RPG/400
RPGLE
HI, Is there a way by which we can override the Library List for a batch job, when the job is active?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Bigmac46
    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 pointsBadges:
    report
  • Yorkshireman
    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,580 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following