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

delete GDG generation


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

New User


Joined: 15 Jul 2005
Posts: 6
Location: Argentina

PostPosted: Thu Nov 24, 2005 2:57 am
Reply with quote

I use a +1 GDG (new,catalog,delete) in DD for IDCAMS
and when a repro fails, the generation doesn't delete.

is it possible?

//OUTDD1 DD DSN=MY.GDG.BASE(+1),
//SYSIN DD *
REPRO INFILE(INDD1) OUTFILE(OUTDD1)
/*
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Nov 24, 2005 5:12 am
Reply with quote

Fizu,

I believe your confusion is in whether the program actually failed in the eyes of the operating system. IDCAMS probably returned a RC=0012, but did not ABEND. If the IDCAMS program were to have abended, the operating system would have deleted the new GDG.

If you need to delete the GDG after a bad return code, you can code the next step to delete the GDG.

Anyone please correct me if I?m wrong.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Thu Nov 24, 2005 11:00 am
Reply with quote

hi frnd,
i think the GDG will delete when there is OS abend codes. as per our frnd said above u can use the LASTCC or any other coding technique to delete the same.
Back to top
View user's profile Send private message
Fizu

New User


Joined: 15 Jul 2005
Posts: 6
Location: Argentina

PostPosted: Thu Nov 24, 2005 9:00 pm
Reply with quote

ok, but how I made it with a GDG

IF LASTCC = 0 THEN DO
...
END
ELSE DO
DELETE *****
END

what I have to put in the **** to made it delete de current generation of the GDG? I don't know witch generation is. I must use the DD name? How I do that? FILE(OUTDD1) doesn't work
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Nov 25, 2005 5:16 am
Reply with quote

Try something like below. The newly created datasets are not cataloged until the termination of the job. So all references to the +1 gen in step JS0100 is still +1 throughout the remainder of the JCL. The COND=(0.EQ.JS0100) says to SKIP this step if the condition is true. So, in the case below, you will delete the +1 gen for anything except a RC=0000.


//JS0100 EXEC PGM=IDCAMS
:
:
//OUTDD1 DD DSN=MY.GDG.BASE(+1),
// DISP=(,CATLG,DELETE),
:
//SYSIN DD *
REPRO INFILE(INDD1) OUTFILE(OUTDD1)
/*
//ABND0100 EXEC PGM=IEFBR14,COND=(0,EQ,JS0100)
//DELDD DD DSN=MY.GDG.BASE(+1),
// DISP=(OLD,DELETE,DELETE)
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Mon Nov 28, 2005 11:22 am
Reply with quote

hi frnd,

Quote:
what I have to put in the **** to made it delete de current generation of the GDG?


use the following GDG to delete the current version
Code:

//STEP1 EXEC PGM=IDCAMS
//SYSIN DD*
DELETE(ACCOUNTS.MONTHLY) GDG FORCE
/*


note that v can use either FORCE/PURGE/ nothing... it depends on ur requirement. refer some previous forums for details
Back to top
View user's profile Send private message
Fizu

New User


Joined: 15 Jul 2005
Posts: 6
Location: Argentina

PostPosted: Mon Nov 28, 2005 9:28 pm
Reply with quote

ok, but DELETE(ACCOUNTS.MONTHLY) GDG FORCE deletes the GDG base, isn't it?.
what I need is to delete the last generation
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Tue Nov 29, 2005 11:20 am
Reply with quote

hi frnd,
try this

Code:
      DELETE(ACCOUNTS.MONTHLY(0)) GDG FORCE


i had not used this. try and let me know
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts DFHPI1008 JSON generation failed COBOL Programming 0
No new posts Started task using a generation dataset JCL & VSAM 7
Search our Forums:

Back to Top