Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Previous GDG generation getting deleted in Merge step.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Previous GDG generation getting deleted in Merge step.
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Apr 24, 2008 5:54 pm    Post subject: Reply to: Previous GDG generation getting deleted in Merge s
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 24, 2008 6:31 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 24, 2008 6:57 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Apr 24, 2008 6:59 pm    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Fri Apr 25, 2008 3:46 pm    Post subject: Reply to: Previous GDG generation getting deleted in Merge s
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

Moderator Team Head


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

PostPosted: Fri Apr 25, 2008 3:47 pm    Post subject: Reply to: Previous GDG generation getting deleted in Merge s
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us