× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

I am trying to call a command from a CL program and can not figure out how to get the qualified name to work using variables. The reason I am going through a CLP is that I want to get a return value from the command and I want to use the prompting capabilitied of commands. Here are some of the things I have tried so far:

Qualified file parm in the command looks like this:
 Your File . . . . . . . . . .   MyFile        Name
                                       MyLib       Name, *LIBL

PARMS to the CLP are &FileName  (10,A) &FileNameLib  (10,A) &ReturnCode (3,A)


CHGVAR VAR(&QUALFILENAME) VALUE(&FILELIB *TCAT +
'/' *Cat &FILENAME)
?MYCMD FILNAM(&QUALFILENAME)
produces 'FILELIB FILENAME' (with quotes) in the file portion of the qualified file name and CPD0078


?MYCMD FILNAM('FILELIB/FILENAME')
produces 'FILELIB/FILENAME' (with quotes) in the file portion of the qualified file name and CPD0078


?MYCMD FILNAM('FILELIB FILENAME ')
produces 'FILELIB FILENAME ' (with quotes) in the file portion of the qualified file name and CPD0078


?MYCMD    FILNAM(MyFIle) +
works okay when I hard code the MyFIle in the CLP

?MYCMD    FILNAM(MyLib/MyFile)
works okay when I hard code the MyLilb/MyFIle in the CLP

When I try to do the above using variables, I can't get it to work.

CHGVAR VAR(&QUALFILENAME) VALUE(&FILENAMELIB *CAT +
&FILENAME)
?MYCMD FILNAM(&QUALFILENAME) +
produces 'FILELIB FILENAME ' in the file portion of the qualified file name and CPD0078


?MYCMD    FILNAM(&FILELIB *tcat '/' *cat  &FILENAME)
 will not compile with expression operator

CHGVAR VAR(&QUALFILENAME) VALUE(&FILENAMELIB *TCAT '/' *CAT &FILENAME)
?MYCMD FILNAM(&QUALFILENAME) +
produces 'FILENAMELIB/FILENAME' (with quotes) in the file portion of the qualified file name and CPD0078


I have tried passing the entire qualified file name to the CLP and I get the same as the above example.

I can't call the CMD with QCMDEXC because commands with return values can only be called from CLP or REXX programs.

Any ideas?

Thanks



Dave Murvin
DRM Enterprises, Inc.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.