Sunday, September 22, 2019

How to find if a GDG BASE does not have any generation

//STEP01 EXEC PGM=IDCAMS              
//SYSPRINT DD DUMMY                   
//SYSOUT DD SYSOUT=*                  
//SYSIN DD *                          
 LISTCAT LEVEL(‘TEST.GDG.NAME’)     
/* 


We can use IDCAMS to check whether any GDG base is empty or any generations exist under a GDG base. LISTCAT is used to find all the properties of a GDG and in the job also this can be used along with defined word LEVEL to find the generations under a GDG base.

IDCAMS job returns ZERO as return code if any generations exist and the return code will be 04 if NO generations exist. 

By checking the return code in the next step,we can decide whether the GDG has any generations or not and subsequent action can be taken accordingly.



No comments:

Post a Comment