Posted: Thu Jul 27, 2006 5:59 pm Post subject: DISP=(MOD,PASS,CATLG) does not delete file after a clean run
If I code DISP=(NEW,PASS,CATLG) for an existing dataset, and job runs clean, the dataset is deleted as expected. If I code DISP=(MOD,PASS,CATLG) and the job runs clean the dataset remains. This is not what I expected. I expected the datset to be deleted as it does with DISP=(NEW. My desire is to mod onto the dataset if it failed before and have it deleted upon completion of a good run.
Joined: 04 Dec 2002 Posts: 71 Topics: 0 Location: Little Falls, NJ
Posted: Fri Jul 28, 2006 12:06 pm Post subject:
>If I code DISP=(NEW,PASS,CATLG) for an existing dataset, and job runs clean, the dataset is deleted as expected.
Huh? You can't use DISP=NEW to reference an existing dataset. If by chance the dataset name does exist, z/OS may allocate another dataset by the same name on a different volume, depending on your system config, SMS, etc. This new dataset will be passed but if the step fails and it has to catalog it, this may fail if the original existing dataset is already cataloged.
>If I code DISP=(MOD,PASS,CATLG) and the job runs clean the dataset remains. This is not what I expected. I expected the datset to be deleted as it does with DISP=(NEW.
If a new dataset is created (DISP=NEW) and its only disposition through all the steps is PASS, then it will be deleted at job end. But an existing dataset (DISP=MOD) will not be deleted by PASS. _________________ Bruce A. Black
Senior Software Developer
Innovation Data Processing
1) I can allocate with NEW even if there it already exists. Both datasets get deleted upon completion of the job. SInce the first file is also deleted I cannot perfrom any recovery on it. So, I was using MOD instead.
2) I want to mod to the DS if it failed previously and then delete when subsequently sucessfully processed. It appears from the link explaining all disp combinations that this is not possible:
If all steps terminated normally:
kept If originally old;
deleted, if originally new
I need to delete in both conditions for normal termination.
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Fri Jul 28, 2006 12:29 pm Post subject:
I didn't quite under your respond to Bruce - Anyway, for solving the MOD problem
For MOD, there's one way of doing it, keep it as MOD,PASS,DELETE in all the steps and in the final step where you reference it and you know if it's succesfully process, do a MOD,DELETE,DELETE
Joined: 04 Dec 2002 Posts: 71 Topics: 0 Location: Little Falls, NJ
Posted: Fri Jul 28, 2006 1:45 pm Post subject:
>1) I can allocate with NEW even if there it already exists. Both datasets get deleted upon completion of the job. SInce the first file is also deleted I cannot perfrom any recovery on it. So, I was using MOD instead.
I doubt that is true. I expect it to delete only the dataset that was created by this job, and not touch the other dataset with the same name on another volume.
To address your problem, as you probably saw from the DISP doc, MOD is a special case. When you say MOD, a catalog lookup is done. If the dataset is found, it is MODed onto; if not, it is treated as NEW (this only works if you don't specify a specific VOL=SER= on the DD).
then, as coolman suggested, have a last step which executes only if the job completes successfuly, with DISP=(MOD,DELETE,DELETE) _________________ Bruce A. Black
Senior Software Developer
Innovation Data Processing
Joined: 09 Mar 2005 Posts: 22 Topics: 0 Location: Stockholm, Sweden
Posted: Thu Aug 17, 2006 8:02 am Post subject: Re: DISP=(MOD,PASS,CATLG) does not delete file after a clean
jvlasvel wrote:
If I code DISP=(NEW,PASS,CATLG) for an existing dataset, and job runs clean, the dataset is deleted as expected. If I code DISP=(MOD,PASS,CATLG) and the job runs clean the dataset remains. This is not what I expected. I expected the datset to be deleted as it does with DISP=(NEW. My desire is to mod onto the dataset if it failed before and have it deleted upon completion of a good run.
I was surprised to see such straightforward answers to such an odd question?!
Dear jvlasvel,
I would be extremely surprised if your statements are true...
...unless you have some surprizingly unorthodox JES exits at your shop!
They would have to make CATLG≡DELETE - very unlikely?!
With the JCL below and two existing datasets for me... (admittedly in Sweden but I believe that is immaterial)...
IEF453I SE16661S - JOB FAILED - JCL ERROR
...
and
...
IEF344I SE16661S CLEANUP EXISTS1 - ALLOCATION FAILED DUE TO DATA FACILITY SYSTEM ERRORDATA FACILITY SYSTEM
IGD17101I DATA SET SE16661.IFTHEN.TEST1
NOT DEFINED BECAUSE DUPLICATE NAME EXISTS IN CATALOG
RETURN CODE IS 8 REASON CODE IS 38 IGG0CLEH
AND both datasets still exist afterwards as one would expect as there is no DELETE (or even UNCATLG )(ugh! with DFSMS?!)
Apart from this these are horrible techniques for coding this wondrous (if ancient in origin) language.
I sugest you study the JCL Reference and User Guides over the coming weekend and test yourself on the course afterwards...
(Official RTFM! ).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum