Midrange News for the IBM i Community


Posted by: SF00001
STRQSH
has no ratings.
Published: 27 Sep 2011
Revised: 23 Jan 2013 - 1522 days ago
Last viewed on: 25 Mar 2017 (4628 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: 5 years 5 months 29 days 16 hours 39 minutes ago
Edited: Tue, 27 Sep, 2011 at 05:51:56 (2006 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: 5 years 5 months 29 days 15 hours 6 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: 5 years 5 months 29 days 14 hours 56 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.