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

How to find whether a Dataset exists or not using JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pralaksh

New User


Joined: 06 Jul 2005
Posts: 1
Location: India

PostPosted: Wed Jul 06, 2005 8:46 am
Reply with quote

Hi All,
Can anyone please let me know the JCL utility to find a dataset exists or not.I think we have a utility that gives a RC of 1 if the DS exists and a zero if it does not.It will be great if anyone can help me out with this.

Thanks,
Lakshmi Narasimhan
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Wed Jul 06, 2005 11:02 am
Reply with quote

Hi,

I think LISTC utility(If awailable on your shop) can be used to check whether the dataset exists.

Example pseudo code can look like this.

//EXIST1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTC ENT('SOME.DATASET.NAME')
// IF RC = 0 THEN
//* executes when dataset exists
??. more JCL here ???.
// ELSE
//* executes when dataset doesn't exist
??. more JCL here ???.
// ENDIF



Corrections welcome.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top