Midrange News for the IBM i Community


Posted by: SF00001
STRQSH
has no ratings.
Published: 27 Sep 2011
Revised: 23 Jan 2013 - 4104 days ago
Last viewed on: 18 Apr 2024 (7576 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

STRQSH Published by: SF00001 on 27 Sep 2011 view comments(3)

Is it possible to parameterize the directory path instead of hardcoding for the below command

STRQSH     CMD('cd /gisflr/telstratest/; ls -l E* > filelist.txt')   

I am using this command in a CL.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: Paulster
Premium member *
Sweden and The Netherlands
Comment on: STRQSH
Posted: 12 years 6 months 24 days 11 hours 30 minutes ago
Edited: Tue, 27 Sep, 2011 at 05:51:56 (4588 days ago)

Hi S,

 

Yep, should be something like:

CHGVAR VAR(&CMD) VALUE('cd /gisflr/telstratest/; ls -l E* > filelist.txt')
STRQSH CMD(&CMD)

 

There should be plenty of examples to demonstrate the above on the www.

 

Happy shelling

Paulster

Posted by: SF00001
Premium member *
Comment on: STRQSH
Posted: 12 years 6 months 24 days 9 hours 57 minutes ago

Hi Paulster,

Thanks for your reply. I tried as below

PGM        PARM(&FR_PATH)  

....

CHGVAR     VAR(&CMD) VALUE('cd' *BCAT &FR_PATH *BCAT '; +
              ls -l E* > filelist.txt')                  

STRQSH    CMD(&CMD)

....

but the command does not seem to be containing valid characters at run time. Any ideas what could be the reason ?

Thanks,

SF

 

Posted by: DaleB
Premium member *
Reading, PA
Comment on: STRQSH
Posted: 12 years 6 months 24 days 9 hours 46 minutes ago

Debug. Display &FR_PATH. Display &CMD after it's built. Is it what you expected?

Does &FR_PATH start with '/' (absolute path)? If not, you'd have to 'cd /' *CAT ...

btw, you don't need spaces before or after the semicolon that separates the commands.