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
 

 

how to delete selective number of generations from one GDG?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Mon Aug 22, 2011 3:02 pm    Post subject: how to delete selective number of generations from one GDG?
Reply with quote

Hi,
I want a JCL code which can delete selective number of versions from one GDG.. Let me give you the details below .

suppose i have

Example.gdg1(1)
Example.gdg1(2)
Example.gdg1(3)
Example.gdg1(4)
Example.gdg1(5)

i need to delete the first 3 alone

i will appreciate if anyone can give me Idea on how shall I go about it.

Regds,
useit
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Aug 22, 2011 3:12 pm    Post subject:
Reply with quote

First of all suspect you need to delete specific generations and not VERSIONS... Get your basics correct..

Now coming to your problem..

What decides the specific generations to be deleted? is it always oldest three?
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Mon Aug 22, 2011 3:34 pm    Post subject:
Reply with quote

escapa,
it is always oldest three

Regds,
useit
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Aug 22, 2011 3:43 pm    Post subject:
Reply with quote

useit wrote:
escapa,
it is always oldest three

Regds,
useit


What you are going to achieve by that?

If you don't need oldest three why not just reduce the limit by three? What is the reason you don't want to do that...?

And finally at all If you really want to do .. REXX could be one of the better candicate ...
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Mon Aug 22, 2011 4:55 pm    Post subject:
Reply with quote

sorry not the oldest three..the limit is 5. and the generation can vary..

am reading gdg base.so which will read all the versions. after processing this i jus have to delete only the generations which was processed in the previous step.(read in the previous step)

because. while deleting some other job ll create a new versions which should not get deleted. so i cant delete all the generations of the gdg.i
should delete only the generations which was processed in the previous step.
i would be really thankful to you if you could help in this regard.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Aug 22, 2011 4:57 pm    Post subject:
Reply with quote

This could be one more way...
Use IDCAMS and list all generations
Parse ouput to create tso delete command
Execute those commands
Code:

//STEP01   EXEC PGM=IDCAMS                                       
//SYSPRINT DD DSN=&&TEMP,DISP=(NEW,PASS)                         
//SYSIN DD *                                                     
  LISTCAT LVL(gdgbasefilename) ALL GDG                     
/*                                                               
//STEP02   EXEC PGM=SORT                                         
//SORTIN   DD DSN=&&TEMP,DISP=(MOD,PASS)                         
//SORTOUT DD  DSN=&&TEMP1,DISP=(NEW,PASS),RECFM=FB,LRECL=80       
//SYSOUT  DD SYSOUT=*                                             
//SYSIN    DD  *                                                 
  OPTION COPY,VLSCMP                                             
  INCLUDE COND=(13,7,CH,EQ,C'NONVSAM')                           
  INREC OVERLAY=(5:C'DEL ''',22,44,C'''')                         
  OUTFIL VTOF,BUILD=(5:5,4,9:9,46,SQZ=(SHIFT=LEFT),80:X),ENDREC=3
//STEP03  EXEC PGM=IKJEFT01                                       
//SYSPRINT DD  SYSOUT=*                                           
//SYSTERM  DD  SYSOUT=*                                           
//SYSTSIN  DD  DSN=&&TEMP1,DISP=(MOD,PASS)                       
//SYSTSPRT DD  SYSOUT=*         
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 22, 2011 5:02 pm    Post subject:
Reply with quote

sounds like: could not fix the brakes, so I made the horner louder.

useit,

the first thing you should do is understand gdg's,
how they work, and why to implement them.

you still have not answered: Why do you think it is necessary to delete these older generations?

there are several ways one can go about deleting files / creating delete parameters,
but why the need?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon Aug 22, 2011 9:37 pm    Post subject:
Reply with quote

Quote:
am reading gdg base.so which will read all the versions. after processing this i jus have to delete only the generations which was processed in the previous step.(read in the previous step)



I am assuming that you mean generations not versions above. These words are NOT interchangable.

Anyway, when you read the GDG Base, use a DISP=(OLD,DELETE,KEEP).

The OLD will ensure no one else is using the GDG. The DELETE will delete all GENERATIONS upon succcessful completion. The KEEP will the data in the event of an abend.

No extra step is required.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Mon Aug 22, 2011 11:16 pm    Post subject:
Reply with quote

Not to cause additional work for the moderators, but why is this thread in the DFSORT/ICETOOL forum instead of the JCL or the SMS & VSAM forum?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 22, 2011 11:25 pm    Post subject:
Reply with quote

Akatsukami wrote:
Not to cause additional work for the moderators, but why is this thread in the DFSORT/ICETOOL forum instead of the JCL or the SMS & VSAM forum?


because to start it seemed that the TS wanted something to generate the "proper" control cards.
after a while, it became obvious that this thread belonged in the
REALLY SILLY REQUIREMENTS forum,
one of which we do not have.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Aug 23, 2011 9:27 am    Post subject:
Reply with quote

Hi,

what happens when the job fails and a new GDG is created by SOME OTHER job ?

How does the job know which GDG's to process ?

I can see many flaws with this process.

Quote:
The OLD will ensure no one else is using the GDG. The DELETE will delete all GENERATIONS upon succcessful completion


A non zero return code will also delete all the GDG's'

So DISP=(OLD,DELETE,KEEP) has it's issues.

Gerry
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 23, 2011 9:31 am    Post subject:
Reply with quote

Hello,

Quote:
should delete only the generations which was processed in the previous step.
No, it should NOT. . .

If this is transient data, there is no reason to use a gdg.

I don't know if the person that made this a requirement is without a clue or was trying to show off somethng that no wellrun system would tolerate.

It simply will not work.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Aug 23, 2011 5:58 pm    Post subject:
Reply with quote

I can not speak for the the TS's requirement, but I use this technique alot.

Scenario:
We have a daily job that tracks trasmissions to a daily log file (GDG).
At the end of the week, a weekly Job (syncsort) rolls up all the generations onto a weekly log file (different GDG). We use the daily base gdg to get all the generations, and delete them all with the disp=(old,delete,keep). we also have a yearly job to roll up all the weekly files onto a single yearly tape (gdg).

Scenario:
Several Jobs can run in a very short time each writing a few records to a new generation to the same gdg. Each of these jobs will trigger another Job (Job B) to process the data. The first occurance of Job B will process all generations (using gdg base) then delete all the generations disp=(old,delete,keep).

So there are reasons to use this technique in our world.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 23, 2011 7:21 pm    Post subject:
Reply with quote

dave,
you are talking about rolling all the gdg's from one base to a new gdg in a second base.

What you described in basic gdg processing.

the TS is talking about deleting the oldest 3 (2?) gdg's in a base.
he is not saving anything, except toilet paper.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Aug 23, 2011 8:40 pm    Post subject:
Reply with quote

Dick,

In is second description he says:
Quote:
am reading gdg base.so which will read all the versions. after processing this i jus have to delete only the generations which was processed in the previous step.(read in the previous step)


This means the same to me as what I described. If he has disp=(old,delete.keep). Those will be deleted.

he later says:
Quote:
because. while deleting some other job ll create a new versions which should not get deleted. so i cant delete all the generations of the gdg.


If he has disp=(old,delete.keep) then the 'other job' will not be able to add any generations until this job is finished with the gdg.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 23, 2011 9:42 pm    Post subject:
Reply with quote

Hi Dave,

Quote:
This means the same to me as what I described.
I have a different understanding. . . What you posted is the way i've seen this done for a long time.

Quote:
i jus have to delete only the generations which was processed in the previous step.(read in the previous step)
I've not yet seen where someone was trying to selectively delete genertions "on the fly" while other generatoins are being created. . .
Back to top
View user's profile Send private message
seagull

New User


Joined: 28 May 2007
Posts: 24
Location: Dublin

PostPosted: Wed Aug 24, 2011 2:45 pm    Post subject:
Reply with quote

It sounds like there is also a lack of understanding about how to use a scheduler. It's quite simple to make the job that uses and deletes the GDG and the job(s) that create generations mutually exclusive. That way, there's no need to piss about trying to determine which generations have just been processed. You can just delete everything that's there.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Wed Aug 24, 2011 3:45 pm    Post subject:
Reply with quote

hi All,
Thanks for the overwhelming response to the query posted .I would like to thank everyone whoever tried providing a solution and helped me coming up with feasible solution for my requirement.

Regds,
useit.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Aug 24, 2011 3:50 pm    Post subject:
Reply with quote

useit wrote:
hi All,
Thanks for the overwhelming response to the query posted .I would like to thank everyone whoever tried providing a solution and helped me coming up with feasible solution for my requirement.

Regds,
useit.

Do post back your final solution.. icon_wink.gif

It might help others....
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Wed Aug 24, 2011 3:59 pm    Post subject:
Reply with quote

hi,
sorry for bothering again.i have a query

LISTCAT LVL will list all the genearations of gdg. can we extract and concatinate those generations in the next step?.

for example.

say STEP 1 LISTCAT LVL Will list below 3 generations.

GDG(1)
GDG(2)
GDG(3)

step 2:
I Just have to concatinate these generations in this step.

say sortin DD DSN=GDG(1)
DD DSN=GDG(2)
DD DSN=GDG(3)

i know reading the base would read All the generations. but there is a chances of some other generation getting created in between.(which i want to prcess in the next run only)

let me know if this is possible?

Regds,
useit
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
No new posts Delete record or Reset RC code using ... mpawan Compuware & Other Tools 4 Tue Jul 26, 2016 3:52 pm


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