View previous topic :: View next topic
|
Author |
Message |
ramangouda patil
New User
Joined: 09 Apr 2008 Posts: 39 Location: India
|
|
|
|
I have to dump duplicate records into a GDG and later count the number of records in this GDG and display the count as well as some other attributes from GDG into a flat file.
For this I am creating a new generation of the GDG
Code: |
//PS033 EXEC PGM=IEFBR14
//NEWVERSN DD DSN=DUPBAKER.STOREGDG(+1),
// DISP=(,CATLG,DELETE),
// RECFM=FB,LRECL=15,
// SPACE=(TRK,(10,5),RLSE),VOL=SER=VSER03,UNIT=DISK
|
then I merge 2 files into this GDG
Code: |
//PS034 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=DUPBKR.UTJOIN1.OUT1,DISP=SHR
//SORTIN02 DD DSN=DUPBKR.UTJOIN2.OUT3,DISP=SHR
//SORTOUT DD DSN=DUPBAKER.STOREGDG(0),DISP=OLD
//SYSIN DD *
MERGE FIELDS=(1,15,CH,A)
/*
|
But this generation of the GDG is getting deleted and a newer version is getting created. Below is from the SYSMSG
Code: |
DUPBKRJ PS034 JS010 - STEP WAS EXECUTED - COND CODE 0000
TEST.BATCH.LOADLIB PASSED,
DUPBKRJ.JOB15985.D0000112.? SYSOUT
DUPBKRJ.JOB15985.D0000113.? SYSOUT
DUPBKR.UTJOIN1.OUT1 RETAINED,
DUPBKR.UTJOIN2.OUT3 RETAINED,
DUPBAKER.STOREGDG.G0005V00 DELETED,
|
Can anyone help me over why the older GDG is getting deleted ? |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Did u check how many generations your GDG base can have?
Thanks.... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't get it.
Why would you just catalog a new generation in one step (PS033) and then use it again in a subsequent step (PS034), instead of creating and cataloging it in step PS034? What purpose does this serve?
I take it that step PS033 creates a new empty generation with the +1 for the next job run cycle, and then step PS034 merges the two files into the previous cycle's empty generation (generation 0).
I agree with the other post. It looks like the LIMIT is set too low. |
|
Back to top |
|
|
ramangouda patil
New User
Joined: 09 Apr 2008 Posts: 39 Location: India
|
|
|
|
Hi all thank you for your replies.
Quote: |
Did u check how many generations your GDG base can have? |
The LIMIT is specified as 255.
Superk you were right about Catlg the GDG twice. I removed the PS033 and created the GDG in PS034 itself (though I had tried it earlier but could not succeed). The Jcl worked but has taken the previous GDG while counting the records using the below
Code: |
//COUNT EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPFILE DD DSN=DUPBAKER.STOREGDG(0),DISP=SHR
//SYSIN DD * COUNT FROM(INPFILE)
|
How do I make it count the records in the present GDG ? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
Can anyone help me over why the older GDG is getting deleted ? |
Because that is the way that GDG's are designed to work. Once the limit is reached, the older generations "drop off" and get deleted. |
|
Back to top |
|
|
ramangouda patil
New User
Joined: 09 Apr 2008 Posts: 39 Location: India
|
|
|
|
Quote: |
Once the limit is reached, the older generations "drop off"
|
Expat
the LIMIT specified is 255. I have just created 10 versions till date. So I dont think that should be an issue. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Code: |
//COUNT EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPFILE DD DSN=DUPBAKER.STOREGDG(0),DISP=SHR
//SYSIN DD * COUNT FROM(INPFILE)
|
If you create the GDG in the same job, then you MUST refer to its relative generation that was specified at the time of creation, if you create +1 then the GDG generation remains as +1 for the life of the job. So if this step is in the same job that created the +1, then use +1 in this step.
As for generations dropping off, are there any other controls on the number of generations in force by your storage group ? I for one have implemented controls on the number of generations allowed to exist at any one time. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
ramangouda patil wrote: |
How do I make it count the records in the present GDG ? |
What do you consider to be the present GDG? Presuming that your job looks something like this:
Code: |
//PS034 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=DUPBKR.UTJOIN1.OUT1,DISP=SHR
//SORTIN02 DD DSN=DUPBKR.UTJOIN2.OUT3,DISP=SHR
//SORTOUT DD DSN=DUPBAKER.STOREGDG(+1),
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(10,5),RLSE),VOL=SER=VSER03,UNIT=DISK
//SYSIN DD *
MERGE FIELDS=(1,15,CH,A)
/*
//*
//COUNT EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPFILE DD DSN=DUPBAKER.STOREGDG(0),DISP=SHR
//TOOLIN DD *
COUNT FROM(INPFILE)
/*
//*
|
Let's say that, before the job runs, DUPBAKER.STOREGDG.G0005V00 is the current generation.
Then, when the job is submitted, generation DUPBAKER.STOREGDG(+1) is the new generation, DUPBAKER.STOREGDG.G0006V00. That means than DUPBAKER.STOREGDG(0) is still the previous current generation, DUPBAKER.STOREGDG.G0005V00.
If you want to count DUPBAKER.STOREGDG.G0005V00, then your code is fine. If you want to count DUPBAKER.STOREGDG.G0006V00, then you need to change the SYNCTOOL DD statement to:
Code: |
//INPFILE DD DSN=DUPBAKER.STOREGDG(+1),DISP=SHR
|
|
|
Back to top |
|
|
ramangouda patil
New User
Joined: 09 Apr 2008 Posts: 39 Location: India
|
|
|
|
Hi Superk / Expat
I had the misconception that DUPBAKER.STOREGDG(+1) would create another GDG even in the COUNT step. But it is not so. Now it is working fine with a '+1' in COUNT step..
Thanks a lot for your valuable suggestions. |
|
Back to top |
|
|
ramangouda patil
New User
Joined: 09 Apr 2008 Posts: 39 Location: India
|
|
|
|
Hi Expat and Superk, now I face a new problem
Now my requirement is that I am calling a PROC >=2 times from a JCL and in the PROC I am trying to copy a file into a new GDG
Code: |
//PS040 EXEC PGM=IDCAMS
//INDD DD DSN=DUPBAKER.TEST.FULLDUP.RPT,DISP=SHR
//OUTDD DD DSN=DUPBAKER.STOREGDG(+1),DISP=(NEW,CATLG),
// DCB=(RECFM=FB,LRECL=121,BLKSIZE=12100),
// SPACE=(TRK,(10,5),RLSE),VOL=SER=VSER03,UNIT=DISK
//SYSPRINT DD SYSOUT=*
//SYSIN DD * REPRO INFILE(INDD) OUTFILE(OUTDD)
/*
|
But only one GDG is being created.On the second run of the PROC, I am getting an error saying "OUTDD - DISP FIELD INCOMPATIBLE WITH DSNAME" How do I create a GDG and not keep the DISP as 'New' ?
Quote: |
if you create +1 then the GDG generation remains as +1 for the life of the job |
If so how do I get to allocate a GDG for each run of the PROC? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
make the generation a parameter to the proc,
and in the second invocation of the proc use "+2" |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
+1 for first call, +2 for seconds call, etc. |
|
Back to top |
|
|
ramangouda patil
New User
Joined: 09 Apr 2008 Posts: 39 Location: India
|
|
|
|
Hi all
Quote: |
make the generation a parameter to the proc |
Well I dont think there is any other way
Actually the JCL is created by a REXX program so didnt want to make changes to that. But I suppose it is inevitable. Anyways thanks a lot ! |
|
Back to top |
|
|
|