Hi All
How to check whether a PS file is cataloged or not in a JCL, need to use the same PS JCL in the second step of the JCL?
I have tried IDCAMS using LISTCAT but it's return zero even when dataset is not found.
How to check whether a PS file is cataloged or not in a JCL?
- Anuj Dhawan
- Founder
- Posts: 2803
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: How to check whether a PS file is cataloged or not in a JCL?
Try this:
Above step will generate return code 4 if 'your.dataset.name' is not cataloged.
Code: Select all
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES('your.dataset.name')
/*
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute