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.
Yep, should be something like:
CHGVAR VAR(&CMD) VALUE('cd /gisflr/telstratest/; ls -l E* > filelist.txt')
There should be plenty of examples to demonstrate the above on the www.
Thanks for your reply. I tried as below
CHGVAR VAR(&CMD) VALUE('cd' *BCAT &FR_PATH *BCAT '; + ls -l E* > filelist.txt')
but the command does not seem to be containing valid characters at run time. Any ideas what could be the reason ?
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.