Tuesday, December 6, 2011

How to find whether a GDG has any generation

Step 1: Use LISTCAT with IDCAMS to list the names of the versions in the GDG
eg)

//STEP001  EXEC PGM=IDCAMS                    
//SYSPRINT DD SYSOUT=*                        
//SYSIN   DD *                                
LISTCAT ENTRIES(userid.xxxx.yyyy.zzzz) NAME
/*


Step 2: From the output of Step 1(you have to direct SYSPRINT to a dataset), use a SORT step to extract the lines that bear the names of the GDG versions - there usually is a unique identifier like 'NONVSAM' in a particular column, or even the GDG BASE name plus a period, which you can use to identify such records.

If the output of Step 2 is empty, you have got no generations for the GDG!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.