by Aki88 » Thu Jun 30, 2016 5:57 pm
Hello,
As Mr. sorichetti and Mr. myers have already stated, the requirement by design - is a bad idea.
Though, if you're still inclined on doing it, one way would be to utilize the 'job scheduler' system which you might be having at your site.
Schedule a job to execute hourly for a batch day, the sole purpose of this job would be to test if the file is available at the server; have another step in this job which executes depending upon the return code of the earlier file check step; this step will submit the JCL1 to INTRDR.
Please note that even though this is a solution, yet there are inherent problems with this approach too. For example:
--> Assuming, the file was present when the first job checked it, JCL1 would run. What will happen to the file at server after this? Will it still remain there or will it be removed? Reason for asking this is, because the execution of the next hourly job will depend on these questions. If the file remains there, then your next hourly job will pick it again and reprocess it.
Simply put, the design is very vague to provide a clean working solution. If you still want to proceed, the above approach will work for you; please speak to your local scheduling team to assist you on how to setup the above approach.
Hth.
Edit: And yeah, JCL alone wouldn't be able to cater to the requirement, you'll need to design a utility/or use an existing tool/utility which can be run through JCL to achieve what you want.