CHGLIBL command in CLLE

50 pts.
Tags:
Application development
Trying to use a single variable with libraries concated from a file. When the command runs in the program I get XXXXX is not a valid library name. If I create a command string with the variable and use QCMDEXEC it works perfectly. The formating of the variable is obviously correct or the qmd call would not work either. Debug just does not give anything to indicate why it is failing.

Answer Wiki

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

Try using the following:
First fill the &libl with the wanted libraries separated by a space . This should work because I am using it all the time.

DCL VAR(&LIBL) TYPE(*CHAR) LEN(2750)
DCL VAR(&CMD) TYPE(*CHAR) LEN(3000)

CHGVAR VAR(&CMD) VALUE(‘CHGLIBL LIBL(‘ *CAT &LIBL +
*TCAT ‘)’)
CALL PGM(QCMDEXC) PARM(&CMD 3000)

Discuss This Question: 1  Reply

 
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
  • WaltZ400
    The reason the command fails when you just take a variable library list and straight out execute a CHGLIBL is that the command is expecting a parameter list. For a list parameter, the values are passed with a binary count of the number of list elements following by the library names. Since you are in theory only passing one library with a really big name, it is only expecting one library with a 10 character name. The first 10 characters of your variable probably has one library and the partial name of the second library in the first 10 bytes of the variable. The CHGVAR concatenating of the the variable into a CHGLIBL is the only way I have been able to do this.
    655 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