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

To Check Existence Of PDS in JCL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bigcoolbudy

New User


Joined: 12 Jun 2006
Posts: 12

PostPosted: Tue Jul 18, 2006 12:10 am
Reply with quote

Hi,

I have to check the existence of a PDS fisrt in the JCL, if it exist then only need to process otherwise exit with sucess from the job with message "File Not found".

Can anyone let me help, how i can handle this.

Thanks
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jul 18, 2006 3:01 am
Reply with quote

You could go with either:

1. Use the TSO LISTDS command.

2. Use a CLIST with the &SYSDSN command or the LISTDSI command.

3. Use a REXX exec with SYSDSN command or the LISTDSI command.

4. Use a program calling ISPF Library Management (LM) services.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jul 18, 2006 3:24 am
Reply with quote

Or, prior to youir program starting, you can test for the existance of the file with IDCAMS

Code:

//JS00100  EXEC PGM=IDCAMS               
//SYSPRINT DD DUMMY                       
//SYSIN DD *                             
  PRINT IDS('YOUR.PDS.TESTFILE') COUNT(1)


IDCAMS will return RC=0 if the file exists, RC=12 if not. You can then selectively execute steps depending on the RC from IDCAMS
Back to top
View user's profile Send private message
bigcoolbudy

New User


Joined: 12 Jun 2006
Posts: 12

PostPosted: Tue Jul 18, 2006 5:47 am
Reply with quote

Thanks David for thereply. I'll code accordingly.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts How to check whether who renamed the ... JCL & VSAM 3
No new posts No ++JCLIN, APPLY CHECK job JCL & VSAM 1
No new posts EMPTY file check scenario JCL & VSAM 6
Search our Forums:

Back to Top