Page 1 of 1

Generate GDG FILE and read all record included in it

PostPosted: Tue Jan 11, 2011 9:29 pm
by jeugenio
Could you help to me

I am doing and JCL to make a GDG FILE and i don´t know if it is correct

//SORT01 EXEC PGM=SORT,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=ORC7.D7.LR.BDK.D7REBRK.COPIA2.SORTOUT,DISP=SHR
//SORTOUT DD DSN=OCI.K3.LR.BDK.K3MP0008.SORT01(+1),
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(50,100),RLSE),
// DCB=(RECFM=FB,LRECL=2300,BLKSIZE=0,DSORG=PS)

and after that i want that all record included in this file pass to other file.

//K3CCA7E1 DD DSN=OCI.K3.LR.BDK.K3MP0008.SORT01,DISP=SHR
//K3CCA7S1 DD DSN=OCI.K3.LR.BDK.K3MP0008.K3CCA7.K3CCA7S1,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(100,50),RLSE),
// DCB=(LRECL=420,RECFM=FB,BLKSIZE=0,DSORG=PS)

Is it is correct?

Re: Generate GDG FILE and read all record included in it

PostPosted: Tue Jan 11, 2011 10:16 pm
by steve-myers
As written, the K3CCA7E1 DD statement specifies what we call a GDG ALL situation. In this situation, all the generations of OCI.K3.LR.BDK.K3MP0008.SORT01 are allocated, with the most recently defined generation, through to the oldest generation, basically in reverse order. You probably want to specify DSN=OCI.K3.LR.BDK.K3MP0008.SORT01(0) to use just the most recently defined generation.

Re: Generate GDG FILE and read all record included in it

PostPosted: Tue Jan 11, 2011 10:17 pm
by Robert Sample
I am doing and JCL to make a GDG FILE and i don´t know if it is correct
Why not? Running the JCL will either result in a new generation of the GDG being cataloged, or it won't. This does not require a rocket scientist to test -- merely someone capable of typing "submit" in TSO, and then look at the output of the job once it has executed.

As long as you are not requiring the GDG data to be sorted in a particular sequence, you can access all generations of the GDG by referencing the GDG base without a generation number. The generations are accessed from most recently created to oldest created (-0 first, -1 second, -2 third, and so forth until the last cataloged generation).

Re: Generate GDG FILE and read all record included in it

PostPosted: Wed Jan 12, 2011 1:11 am
by dick scherrer
Hello,

Just a comment that the lrecl is different for the files beng created. . . .

May be just fine, but may not - depending.