How to refer GDG generation if generation is created in step 2 and same i refer in step 3

user1776796 picture user1776796 · Oct 26, 2012 · Viewed 19.7k times · Source

I have faced an issue in GDG generation in production.

New generation is created in STEP 2:

//INP DD DSN=sample.test(+1),  
//      DISP=(,CATLG,KEEP),                     
//       SPACE=(CYL,(50,20),RLSE),               
//       DCB=(RECFM=FB,LRECL=1020,BLKSIZE=4080)  

The same generation is refered in STEP 3:

//step3 exec PGM=SORT                               
//SORTIN   DD DSN=sample.test(+1),    
//            DISP=SHR                                 
//SORTOUT  DD DSN=xxxx.yyyy,     
//            DISP=(NEW,CATLG,DELETE),                 
//            UNIT=(SYSDA,9),DCB=(RECFM=FB,LRECL=132), 
//            SPACE=(CYL,(50,20),RLSE)     

I gave like this, but fails with JCL error.

Can anyone help on why this fails?

As per theory once job has completed only. We have to refer with 0th version. In Same job we have to refer with +1 Version. If i changed to 0th version in step 3 then the job ran fine.

Answer

Simon Earle picture Simon Earle · Oct 26, 2012

You need to specify the message number, IEF… The default disposition in the INP step is NEW so the message indicates that the dataset already exists - without seeing the other steps in the deck it's hard to help.