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
 
Checking existence of file in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kris_chennai

New User


Joined: 19 Dec 2005
Posts: 7
Location: Chennai

PostPosted: Fri Dec 23, 2005 4:40 pm    Post subject: Checking existence of file in JCL
Reply with quote

Hi,

Could you help me? the requirement is

// SET DATASET=1205
// SET PDATASET=1105



//I1MW20FL DD DSN=TST.CTS.TEST1.M&DATASET

if for example data set M1205 is available we need to take the data set processing else we need to take previous month processing (PDATASET)

How do I check the data set is available for processing @ run time..
Back to top
View user's profile Send private message

MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Dec 23, 2005 6:56 pm    Post subject:
Reply with quote

You can do this using a constructed jcl(that can be also a proc to reduce the maintenance) that exec different blocks:
i.e.
Code:
//* NEW BLOCK (GEN)                             
//STEP010I EXEC PGM=IDCAMS                       
//SYSPRINT DD SYSOUT=*                           
//SYSIN    DD *                                 
  LISTCAT ENTRIES(MY GEN FILE) ALL               
//* MY PROGRAM WITH MY INPUT FILE (GEN)
//STEP010P EXEC PGM=IEFBR14,COND=(0,NE,STEP010I)
//* NEW BLOCK (FEB)                             
//STEP020I EXEC PGM=IDCAMS                       
//SYSPRINT DD SYSOUT=*                           
//SYSIN    DD *                                 
  LISTCAT ENTRIES(MY FEB FILE) ALL           
//* MY PROGRAM WITH MY INPUT FILE (FEB)   
//STEP020P EXEC PGM=IEFBR14,COND=(0,NE,STEP020I)


or you can do this using a single Rexx program to do all in a step.
Rember that the SET statement will work only in JCL statement and not in instream parameters.

I hope in this help.

P.S.= if you search in this forum you will find many other solution.
Back to top
View user's profile Send private message
kris_chennai

New User


Joined: 19 Dec 2005
Posts: 7
Location: Chennai

PostPosted: Fri Dec 23, 2005 8:31 pm    Post subject:
Reply with quote

Hi LISTCAST entry should be passed from JCL. How can I do that. The entry should not be static..
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Dec 23, 2005 8:52 pm    Post subject:
Reply with quote

If you submit the jcl above from your userid you will get some error because SET statement allow substitution only in JCL statement and not in instream parameter or DD DATA.
The only way to change the value before the submit is from a scheduler or a trick.

I hope in this help.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Dec 24, 2005 10:49 pm    Post subject:
Reply with quote

Hi Kris,

One way to accomplish this is to use the INTRDR. Do a search here. There is a lot of info available.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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