View previous topic :: View next topic
|
Author |
Message |
bigcoolbudy
New User
Joined: 12 Jun 2006 Posts: 12
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
bigcoolbudy
New User
Joined: 12 Jun 2006 Posts: 12
|
|
|
|
Thanks David for thereply. I'll code accordingly. |
|
Back to top |
|
|
|