Lets say my file name is abc.txt. If this file is found on SFTP server then I need to execute another procedure jcl, named as procb.
If abc.txt file is not found then no need to execute procb
Here is the requirement
Job A will need to have two procs named as proc a and proc b
JobA
------
Step1 exec proca
Step2 exec procb (Note: Step2 will be executed if file, abc.txt is found on the SFTP server else bypass step2)
Proca: This proc will look for a file, abc.txt on SFTP server then sets return code 0 if it is found else sets return code other than 0. Can you please guide me how to code this especially setting up the return code and passing back to jcl and use the same return code in the subsequent steps
Procb: Based on the proc a return code this proc will be executed.
How to check for a file existence on SFTP server using JCL
If you modify the "RUNSFTP" sample JCL and replace the line:
with:
You will get a CC=1 from the STEP if the file doesn't exist, and CC=0 if it does.
Code: Select all
get $remotefile //DD:DOWNLOAD
Code: Select all
ls $remotefile