View previous topic :: View next topic
|
Author |
Message |
hiravibk Warnings : 1 Active User
Joined: 14 Dec 2008 Posts: 107 Location: India
|
|
|
|
Hi,
I have a JCL for which the input file is the latest version of a GDG. But, there are cases when the latest version of GDG is not avilable, and only GDG base is available. The JCL throws up JCL error in these cases. Is there any way to check the availability of a file using a JCL? If the file is present the JCL should be doing a certain set of operation, and if the file is not present it should do another set of operations..
Thank you,
Ravi. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Yes, you can run the IDCAMS LISTCAT command in batch, and then follow a set of processes depending on the results. |
|
Back to top |
|
|
hiravibk Warnings : 1 Active User
Joined: 14 Dec 2008 Posts: 107 Location: India
|
|
|
|
SuperK,
Thank you so much for your suggestion.
superk wrote: |
Yes, you can run the IDCAMS LISTCAT command in batch, and then follow a set of processes depending on the results. |
Could you please provide me a sample JCL for this??
Thank you, |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
hiravibk wrote: |
Could you please provide me a sample JCL for this??
Thank you, |
Why, can you NOT read a manual yourself or at least google it ? |
|
Back to top |
|
|
hiravibk Warnings : 1 Active User
Joined: 14 Dec 2008 Posts: 107 Location: India
|
|
|
|
Hi,
I tried the below code,
Code: |
//STEP0100 EXEC PGM=IKJEFT01
//SYSTSPRT DD DSN=aa333.output,disp=shr
//SYSTSIN DD *
LISTCAT ENT('aa7788.check.ds') ALL
//* |
I understand that i get a return code of 4 if the file 'aa7788.check.ds' is not found and a return code of 0 if the file is found. but i have a problem in using the code for checking the latest version of GDG..To check for the latest version of GDG, i need to mention the GDG name as 'a999.eeee.r(0)'...but the system does not accept this and throws a JCL error saying value 'a999.eeee.r(0)' should have been an entry name...Please tell me how can i solve this issue..
Thank you, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to scan the output of the listcat and see if any generations are currently cataloged. |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi,
My file name is in passed as parameter to proc.
INFILE=AAA.BBB
I want to check for above file if it exists or not in proc using symbolic override. May you let me know how to use it:
for testing i tried using SET parameter as follow:
// SET DSNUT1=AAA.BBB
//JS10 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES("&INFILE")
/*
But i am getting JCL error. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
though there is an exception
(that i forget / actually ignore/ i am sure someone will post the exception)
instream data can not contain symbolics
it can, but the substitution will not be made.
a quick and dirty change would be:
//INFILE DD DSN=smbolic
listcat entry(INFILE) |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You've tailgated an old topic. Please don't, but start a new topic for a new question.
You did not get a JCL error (not with what you posted) you got an error in IDCAMS.
If you were on the latest z/OS you should be able to do it, so you're not.
If you want to know if it exists, just including it on a DD name will tell you, as the Job will fail if the file doesn't exit.
What are you actually trying to do? |
|
Back to top |
|
|
|