AS400 – COPYBOOK

1,215 pts.
Tags:
AS/400 Library
AS400 - Copy Book
QRPGLESRC
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?
ASKED: February 22, 2011  1:58 PM
UPDATED: February 23, 2011  4:24 PM

Answer Wiki

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

Without a whole lot of work, you cannot change FILENAME.
But, if you do not specify the LIBRARy, it will use *LIBL.
I’d be interested to know why you would want to do this.
It seems like it could cause a potential problem down the line,

====================================================================
CharlieBrown,

In a Change Management Environment when Promoting either the copybook and/or the programs from a Developers Library up to Test and/or Production, you would want the Libraries to change dynamically based on the library list.

Hope this helps,
Bill Poulin

=========
Thanks BIl
I should have mentioned that.
We use MKS so that happens all the time.

Discuss This Question: 3  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
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • TomLiotta
    Typo correction -- You can change it at run-time by using... Should be: You can change it at compile-time by using... Tom
    125,585 pointsBadges:
    report
  • rajeshece
    [...] 2. CharlieBrowne, Wpoulin, and TomLiotta team up to help a member with a question about AS/400 copybooks. [...]
    0 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