Showing posts with label GDG. Show all posts
Showing posts with label GDG. Show all posts

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.



CONCATENANTION OF GDG VERSIONS USING BASE NAME – GDGORDER

If your GDG base has 3 versions, and you want to concatenate all the 3 versions and use as input to a program in JCL, instead of mentioning all the 3 version names, you could just mention the GDG base name and the JCL would use all the versions in LIFO (Last In First Out) order

Suppose you have a GDG File (YOUR.GDG.FILE) has 2 versions as below.

YOUR.GDG.FILE.V01
YOUR.GDG.FILE.V02
YOUR.GDG.FILE.V03

To user all the versions with LIFO, you can either mention as below

//INPUT DD DSN=YOUR.GDG.FILE

Or as below

//INPUT DD DSN=YOUR.GDG.FILE.V03
// DD DSN=YOUR.GDG.FILE.V02
// DD DSN=YOUR.GDG.FILE.V01

IBM has introduced a new parameter GDGORDER in which you can mention the order of versions when using just the BASE.

//INPUT DD DSN=YOUR.GDG.FILE,GDGORDER=LIFO

Above is the default parameter

Sometime you want read the first version of the GDG first and then with other versions in increasing order. In this case, you can define as below.

//INPUT DD DSN=YOUR.GDG.FILE,GDGORDER=FIFO

Above code is similar to below  code

//INPUT DD DSN=YOUR.GDG.FILE.V01
// DD DSN=YOUR.GDG.FILE.V02
// DD DSN=YOUR.GDG.FILE.V03

Monday, September 9, 2019

How to modify GDG limit

//STEP01     EXEX PGM=IDCAMS
//SYSOUT     DD SYSOUT=*
//SYSUDUMP   DD SYSOUT=D
//SYSPRINT   DD SYSOUT=*
//SYSIN      DD *
    ALTER gdabase name  LIMIT(number of limit)
//*