Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Check for the existence of 4 files in a JCL step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Check for the existence of 4 files in a JCL step
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

Site Director


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

PostPosted: Thu May 03, 2007 8:32 pm    Post subject:
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: 2360
Location: Israel

PostPosted: Sun May 06, 2007 11:01 am    Post subject:
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: 8631
Location: Back in jolly old England

PostPosted: Sun May 06, 2007 1:33 pm    Post subject:
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

Site Director


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

PostPosted: Sun May 06, 2007 10:07 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us