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.
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.
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
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
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.