View previous topic :: View next topic
|
Author |
Message |
Fizu
New User
Joined: 15 Jul 2005 Posts: 6 Location: Argentina
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
Fizu
New User
Joined: 15 Jul 2005 Posts: 6 Location: Argentina
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
Fizu
New User
Joined: 15 Jul 2005 Posts: 6 Location: Argentina
|
|
|
|
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 |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
try this
Code: |
DELETE(ACCOUNTS.MONTHLY(0)) GDG FORCE |
i had not used this. try and let me know |
|
Back to top |
|
|
|