View previous topic :: View next topic
|
Author |
Message |
aneeta
New User
Joined: 08 Dec 2005 Posts: 48 Location: Chennai
|
|
|
|
In my job, first I need to check if 4 files (files are already created in different jobs) of length 80,FB are present in a step. If atleast one of the file is present, then I need to execute Step2 otherwise execute Step3.
Pls let me know if I need to provide more information.
Thanks
Aneeta |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post the jcl you have so far. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Sound like a simple job for REXX with LISTDSI and EXIT RC.
O. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
If atleast one of the file is present, then I need to execute Step2 otherwise execute Step3. |
How do you intent to allocate the file(s). Obviously the JCL will need to change to reflect the files that are there and those that are not.
As you can not dynamically change the JCL once it has been interpretted by JES, you may find yourself getting a few more JCL errors than you want to.
Quote: |
Sound like a simple job for REXX with LISTDSI and EXIT RC. |
Which given the circumstances is about the only viable option.
To add to this, it might be worth performing a merge of those inputs that do exist in the REXX so that you will have a known named file being created for later processing. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Another option would be to use a common gdg. All ot the input datasets would be created as a +1 of the common gdg in the 4 creating jobs. Step2 would read all of the cataloged versions and process according to whether it read the first record or reached AT END on the first read.
To start this process and each time the entire gdg collection is used, all cataloged versions would be deleted and a new 1st version would be created with a valid EOF (so when read, the program would detect AT END on the first read).
If step2 reached AT END on the first read, there is no input. There is no need for checking if files exist or any other jcl concerns. |
|
Back to top |
|
|
|