I have changed Copy Book which is used in two programs. I have defined the Copybook Using /COPY LIBRARY/QRPGLESRC CPYBK1. Is there any possiblity to change Library and Source Physical File Name Dynamically?
Software/Hardware used:
ASKED:
February 22, 2011 1:58 PM
UPDATED:
February 23, 2011 4:24 PM
Is there any possiblity to change Library and Source Physical File Name Dynamically?
When do you want to change it?
You can change it at run-time by using condition names in the DEFINE() parameter and coding your /COPY members with Conditional Compilation Directives. You can code your /COPY member to supply different values that depend what you supply in the DEFINE() parameter.
In your case you could have one /COPY member that would supply either a nested /COPY statement for LIBRARYA or another one for LIBRARYB. By nesting /COPY statements and choosing different ones under different conditions, you can get any final result you need.
But that has to happen at compile-time.
There is no way to affect a /COPY statement at any other time.
Tom
Typo correction –
You can change it at run-time by using…
Should be:
You can change it at compile-time by using…
Tom