Page 1 of 1

GDG Member existence

Posted: Thu Jul 16, 2009 2:26 pm
by iChandhu
Is it possible to find out if the GDG has any versions created?

I want to check if the versions exist and then go copy all the versions into a local PDS.
JCL is abending if the versions are not available and if I try to copy all versions.

Posted: Thu Jul 16, 2009 5:18 pm
by Natarajan
Yes it is possible.

Posted: Thu Jul 16, 2009 5:45 pm
by iChandhu
How ??
I mean using IDCAMS ??

Posted: Fri Jul 17, 2009 10:33 pm
by Anuj Dhawan
Probably you mean "Generations". Generations and versions both are valid terms in the context of "GDS" but they have very different meanings.
if the versions exist and then go copy all the versions
You can use "gdg-base" as input...?

Posted: Fri Jul 17, 2009 10:36 pm
by Anuj Dhawan
In this
if the versions exist and then go copy all the versions into a local PDS.
bold text needs explanation? :?
JCL is abending if the versions are not available and if I try to copy all versions.
If you show us the JCL used and the SYSOUT messages from the failed job, some one can have a better suggestion.

checking GDG versions availability with IDCAMS LISTCAST

Posted: Mon Jul 20, 2009 2:12 pm
by Natarajan
Hi Chandu,

Here is solutions for this.

Code: Select all

//PS010 EXEC PGM=IDCAMS 
//SYSPRINT DD DUMMY 
//SYSOUT DD SYSOUT=* 
//SYSIN DD * 
LISTCAT LEVEL('DEV.GDG.BASE') 
/* 
This Utility will return (RC = 0) Zero if GDG Generation exists for the base mentioned in LISTCAT option.

If the GDG base does not have any generation then it will return code of 4.

Posted: Thu May 01, 2014 12:42 pm
by smitha Shetty
Hi,

I tried using LISTCAT level commang but it is returning RC code as 0000 for everything. I need to copy all the versios of GDG into another GDG is versions exists. This is throwing a JCL error is versions are not present. Can somebody please guide?

Posted: Thu May 01, 2014 1:12 pm
by NicC
The LISTCAT gives a return code of zero as it successfully undertook the task assigned to it. no datasets to list? No problem, do not list - success! Could not read the catalog? Woops - error! If you are going down the listcat route you need to write the output to a dataset, write a program to analyze that dataset and issue a return code based on the analysis. The next step would run/not run dependent on that return code.

I presume you mean generation and not version - the bit after the V in GxxxxVxx is the version wheras Gxxxx is the generation. Also no JCL error was "thrown" - things are not "thrown" on the mainframe. Your job may have failed with a JCL error.

Posted: Mon May 12, 2014 12:01 pm
by Anuj Dhawan
This is throwing a JCL error is versions are not present.
From memory - you should get a RC=4, if the GDG Base exists and not an error. Can you please show us the error you are getting.

ALSO, you've replied to a 5 year old post - it's usually better to start a new thread with your question and in doing so you might refer back to the previous post you've looked at otherwise your own question get mingled with the original question of previous thread and you might not get a direct answer to your question.

Posted: Mon May 12, 2014 1:18 pm
by NicC
seems to have disappeared!