I want to specify a library list while compiling. So I will do a SBMJOB. I want the object to look for reference object in these libraries, but don't want to add them in the user library list.
2 Answers
When compiling a program, the source code can reference many types of objects, and not all of them have an associated OVRxxx command - data areas in particular come to mind. So you can't necessarily issue OVRDBF and OVRPRTF commands before compiling. You might miss some objects that way.
I think that the easiest way is to create a new job description; one which has the appropriate library list. When you do your SBMJOB to compile the program, use that job description.

- 7,558
- 22
- 25
-
1A *JOBD object is an appropriate place to store a library list for later use, and it works well with SBMJOB. – user2338816 Nov 06 '14 at 12:47
i think you don't need to worry about changing user-libl as it's your job and for just compiling. when job ends it's gone. But if you plan to run the pgm after compiling within the job and you worry about changing job's libl, you can save current libl into var via RTVJOBA cmd, manipulate libl as your pgm needs, then restore back libl via CHGLIBL cmd from the saved var.
-
That can work when compiling interactively and also when using SBMJOB INLLIBL(*CURRENT). But the list of libraries still needs to be manipulated, likely by retrieving it from some storage space. Might as well just use a *JOBD to store the list. That's something they're good for. – user2338816 Jan 25 '16 at 15:12