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

Dataset got deleted


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

Senior Member


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

PostPosted: Wed Dec 12, 2012 6:01 am
Reply with quote

Systems programmers are checking about this issue but I thought i would post here too.

We have a job for which STEP140 creates dataset and is used in STEP145
Step 145 runs quickjob program and creates an output dataset. Below is snipet of jcl
Code:

28 XXSTEP140 EXEC PGM=SORT
29 XXSORTIN01 DD  DSN=A.B.C.D1(0),
   XX             DISP=OLD
30 XXSORTIN02 DD  DSN=A.B.C.D2,
   XX             DISP=(OLD,DELETE,KEEP)
31 XXSORTIN03 DD  DSN=A.B.C.D3(0),
   XX             DISP=OLD
32 XXSORTIN04 DD  DSN=A.B.C.D4(0),
   XX             DISP=OLD
33 XXSORTOUT  DD  DSN=A.B.C.D5,LABEL=EXPDT=99000,
   XX             DISP=(,CATLG,DELETE),
   XX             UNIT=CART,
   XX             VOL=(,RETAIN,,35),
   XX             RECFM=FB,LRECL=168,DSORG=PS
34 XXSYSIN    DD  DSN=HLQ.PARMLIB(XYZ),
   XX             DISP=SHR
35 XXSYSOUT   DD  RECFM=VBA,
   XX             LRECL=125,SYSOUT=V
36 XXSYSUDUMP DD  SYSOUT=D
   XX*___________________________________________________
37 XXSTEP145 EXEC PGM=QUIKJOB
38 XXSYSUT1   DD  DSN=A.B.C.D5,
   XX             DISP=(OLD,DELETE,KEEP)
39 XXSYSUT2   DD  DSN=A.B.C.D6,LABEL=EXPDT=99000,
   XX             DISP=(,CATLG,DELETE),
   XX             UNIT=CART,
   XX             VOL=(,RETAIN,,35),
   XX             RECFM=FB,LRECL=168,DSORG=PS
40 XXERRORRPT DD  SYSOUT=(W,ERPT),
   XX             RECFM=FBA,LRECL=166
41 XXSUMRPT   DD  SYSOUT=O,                 
   XX             RECFM=FBA,LRECL=133
42 XXSYSIN    DD  DSN=HLQ.VISION(ABC),
   XX             DISP=SHR
43 XXSYSOUT   DD  SYSOUT=V
44 XXSYSPRINT DD  RECFM=FBA,
   XX             LRECL=133,SYSOUT=V
45 XXSYSUDUMP DD  SYSOUT=D


Now when A.B.C.D6 is in catalogue and if I restart the job,
I am not understanding why A.B.C.D5 is getting uncatalogued\deleted.

Code:

this is from step 140
.IGD108I A.B.C.D5                          CATALOGED, DDNAME=SORTOUT
.        VOLUME SERIAL NUMBERS =
.        917840


Code:

IEF236I ALLOC. FOR PCMPSD STEP145 PCMPSD
IGD100I 06A9 ALLOCATED TO DDNAME SYSUT1
IGD100I 06BA ALLOCATED TO DDNAME SYSUT2
        STORCLAS (VTSREG) MGMTCLAS (VTSBOTH) DATACLAS (VTS4GB)
IEF237I JES3 ALLOCATED TO ERRORRPT
IEF237I JES3 ALLOCATED TO SUMRPT
IGD103I SMS ALLOCATED TO DDNAME SYSIN
IEF237I JES3 ALLOCATED TO SYSOUT
IEF237I JES3 ALLOCATED TO SYSPRINT
IEF237I JES3 ALLOCATED TO SYSUDUMP
IEC205I SYSUT2,PCMPSD,STEP145,FILESEQ=1, COMPLETE VOLUME LIST,
DSN=A.B.C.D6,VOLS=918408,TOTALBLOCKS=177334
IEF142I PCMPSD STEP145 PCMPSD - STEP WAS EXECUTED - COND CODE 0000
IEF285I   A.B.C.D5                          UNCATALOGED
IEF285I   VOL SER NOS= 917840.
IEF285I   A.B.C.D5                          DELETED
IEF285I   VOL SER NOS= 917840.
IGD17101I DATA SET A.B.C.D6
NOT DEFINED BECAUSE DUPLICATE NAME EXISTS IN CATALOG
RETURN CODE IS 8 REASON CODE IS 38 IGG0CLEH
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 12, 2012 6:28 am
Reply with quote

Because A.B.C.D5 has DISP=(OLD,DELETE,KEEP) and the step ran to zero completion code, so it is deleted. The presence of A.B.C.D6 in the catalog does NOT cause an abend hence the KEEP will not occur.
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Wed Dec 12, 2012 7:37 am
Reply with quote

But shouldn't step not execute as output dataset is present in catalogue?

Whats the way out in such case?

Today, we had this case where input A.B.C.D5 got deleted and output A.B.C.D6 did not get created as duplicate name was present.

We were lucky that A.B.C.D5 was tape dataset and wasnt scratched yet so we could re-catalogue to rerun the job.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Dec 12, 2012 11:44 am
Reply with quote

Hi,

that seems to only apply to disk datasets ie. step would have not executed and failed with JCL error.

The only suggestion I have is to change to a GDG.


Gerry
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Dec 12, 2012 1:58 pm
Reply with quote

or insert a clean-up step before step 145
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Wed Dec 12, 2012 2:00 pm
Reply with quote

Shouldn't this result in a NOT CATLGD 2 ?

I seem to recall an option somewere that then determines whether these cause the job to fail with a JCL error or not.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 12, 2012 5:25 pm
Reply with quote

Quote:
But shouldn't step not execute as output dataset is present in catalogue?

Whats the way out in such case?
Why would the presence of an output data set in the catalog keep the step from running? If this were the case, system programmers would have a harder time since it is not uncommon for a system programmer to create a data set on a disk volume EVEN THOUGH THAT DATA SET IS CATALOGED ON ANOTHER DISK VOLUME so the system programmer can then uncatalog the data set and catalog the data set just created.

There actually is not much of a way out in this case, since your system is working precisely as IBM designed it. A system may have MANY data sets with the exact same name -- only one of them can be in the catalog but there is no limit on how many can be created -- so your expectation that the job will not run if an output data set is cataloged is, quite simply, totally unrealistic.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Dec 12, 2012 9:06 pm
Reply with quote

Hello,

Suggest some invest the time to review / revise the process so this "out of sync" condition cannot occur. . .
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Dec 13, 2012 2:56 am
Reply with quote

Hi,

by the way DISP=(OLD,DELETE,KEEP) will delete the dataset regardless of what the completion code is.



Gerry
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Thu Dec 13, 2012 4:02 am
Reply with quote

Possibly change DISP of A.B.C.D5 in STEP145 to OLD
and then delete A.B.C.D5 as the last step of your job.
A.B.C.D5 will still be CATLGed for any restarts.
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Thu Dec 13, 2012 6:23 am
Reply with quote

Disp of A.B.C.D5 is changed to OLD,KEEP,KEEP AND IEFBR14 at end to DELETE it.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Dec 13, 2012 2:47 pm
Reply with quote

Quote:
Disp of A.B.C.D5 is changed to OLD,KEEP,KEEP
does not change its disposition - it still remains catalogued.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 13, 2012 8:03 pm
Reply with quote

Hello,

Until the IEFBR14 at the end to delete it?
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Thu Dec 13, 2012 8:55 pm
Reply with quote

dick scherrer wrote:
Hello,

Until the IEFBR14 at the end to delete it?

Yes, dataset A.B.C.D5 will remain CATLG-ed from STEP145 and then deleted in last step.
I like this non-GDG setup/technique in case any restarts are needed.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Dec 31, 2012 6:59 pm
Reply with quote

With SMS, KEEP is equivalent to CATLG - the data set will be kept on the volume when the step ends normally. And KEEP is the only valid termination disposition for a VSAM data set.VSAM files shouldn't be cataloged, uncataloged, passed, or deleted - and I hope you are at an SMS shop.(no - icon_eek.gif)
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top