IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Check for the existence of 4 files in a JCL step


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Thu May 03, 2007 7:55 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 03, 2007 8:32 pm
Reply with quote

Hello,

Please post the jcl you have so far.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sun May 06, 2007 11:01 am
Reply with quote

Sound like a simple job for REXX with LISTDSI and EXIT RC.

O.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sun May 06, 2007 1:33 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun May 06, 2007 10:07 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top