Parsing parameters for a Command to be run In a CL

200 pts.
Tags:
CLP
I need to allow a user to enter a command at the command line followed by the &Library/File, or just the &Filename. (if they are going to rely on their library list). EX: SHOWME &LIBRARY/FILE or SHOWME &FILE My CMD is running the true IBM Command under the covers so the user does not need to wade through all the additional parameters they don't need. My issue is that I can't seem to get the &Library/File or &File parameter to the IBM Command as one entity. If I specify the &Library/File the command complains the file name is not correct. Job log shows the command used the library name as the file name. If I only specify the &File I still receive the same message. Any code examples or suggested reading would be very helpful. Thank you.
ASKED: April 10, 2007  12:11 PM
UPDATED: April 12, 2007  2:57 PM

Answer Wiki

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

create command source member as follows:

CMD PROMPT(‘Show File Contents’)
PARM KWD(FILE_LIB) TYPE(Q1) MIN(1) PROMPT(‘File’)
Q1: QUAL TYPE(*NAME) MIN(1)
QUAL TYPE(*NAME) DFT(*LIBL) SPCVAL((*LIBL)) +
MIN(0) PROMPT(‘Library’)

creat CL source member as follows:

PGM PARM(&FILLIB)

DCL VAR(&FILLIB) TYPE(*CHAR) LEN(20)
DCL VAR(&FIL) TYPE(*CHAR) LEN(10)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)

CHGVAR VAR(&FIL) VALUE(%SST(&FILLIB 1 10))
CHGVAR VAR(&LIB) VALUE(%SST(&FILLIB 11 10))

DSPF FILE(&LIB/&FIL)

ENDPGM

then compile both members

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
  • FCARPENTER
    Thanks for the assistance
    200 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