IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Previous GDG generation getting deleted in Merge step.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Thu Apr 24, 2008 5:04 pm
Reply with quote

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
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Thu Apr 24, 2008 5:53 pm
Reply with quote

Did u check how many generations your GDG base can have?

Thanks....
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Apr 24, 2008 5:54 pm
Reply with quote

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
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Thu Apr 24, 2008 6:28 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 24, 2008 6:31 pm
Reply with quote

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
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Thu Apr 24, 2008 6:45 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 24, 2008 6:57 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Apr 24, 2008 6:59 pm
Reply with quote

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
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Thu Apr 24, 2008 7:20 pm
Reply with quote

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. icon_biggrin.gif
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Fri Apr 25, 2008 3:45 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Apr 25, 2008 3:46 pm
Reply with quote

make the generation a parameter to the proc,
and in the second invocation of the proc use "+2"
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Apr 25, 2008 3:47 pm
Reply with quote

+1 for first call, +2 for seconds call, etc.
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 39
Location: India

PostPosted: Fri Apr 25, 2008 3:55 pm
Reply with quote

Hi all
Quote:
make the generation a parameter to the proc

Well I dont think there is any other way icon_neutral.gif
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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts DFHPI1008 JSON generation failed COBOL Programming 0
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
Search our Forums:

Back to Top