I need to save, somehow, the initial library list before calling a program
that randomly changes itself the job library list.
After finishing the program then we should restore the original library
list.
Is there any way to achive this?
Using something similar to:
PGM
DCL VAR(&INIUSRLIBL) TYPE(*CHAR) LEN(2750)
RTVJOBA USRLIBL(&INIUSRLIBL)
CALL PROGRAM /*That program changes the library list*/
CHGLIBL LIBL(&INIUSRLIBL)
ENDPGM
It does not work, stopping with CPD0078 since I should declare each element
of the new library list for parameter INLLIBL as a independent variables.
Any Ideas?
Thanks in advance.
> Hi.
Hello
Try using QCMDEXC API,
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/rbam6/execp
.htm
Build the the first parameter with something like that
'CHGLIBL LIBL(' *TCAT &INIUSRLIBL *TCAT ')'
>
> Thanks in advance.
>
>
>
--
Cordialement
Marc Rauzier
(pour me répondre, ne pas utiliser le from mais le reply-to)
On Wed, 24 Nov 2010 11:48:39 -0000, "CENTRINO" <no...@nonelandia.com>
wrote:
>It does not work, stopping with CPD0078 since I should declare each element
>of the new library list for parameter INLLIBL as a independent variables.
Instead of running the CHGLIBL command directly (where the command
sees the entire contents of &INIUSRLIBL as being one library name)
build the entire CHGLIBL command string in a variable and execute it
with QCMDEXC. Then the blanks between the library names in
&INIUSRLIBL will act as delimiters.
--
Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.
Even with correction to CHGLIBL handling by QCMDEXC [or any other
command string processor], realize that if the CLP does not establish a
means to handle an interrupt by ENDRQS and\or unmonitored exception
handling to effect the reset of the library list, then continued
processing in the job [after the CLP is ended] will operate under the
modified library list. Note there have been utilities with names such
as PUSHLIBL and POPLIBL or SAVLIBL and RSTLIBL [e.g. by using a LIFO
queue to push and pop to allow for nested user library list changes] to
handle similar inquiries, along with discussions of alternate ideas
depending on the scenario.
If having the wrong library list left established in the job could be
problematic, then the CL Program should either send a scope message to
effect [thus as coded, to also replace] the CHGLIBL, or as ILE establish
a termination handler for the procedure and\or activation group using
the CEERTX "Register Call Stack Entry Termination User Exit Procedure"
API or CEE4RAGE "Register Activation Group Exit Procedure" API.
Regards, Chuck