DISP=(MOD,PASS,CATLG) does not delete file after a clean run
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Job Control Language(JCL)

#1: DISP=(MOD,PASS,CATLG) does not delete file after a clean run Author: jvlasvel PostPosted: Thu Jul 27, 2006 5:59 pm
    —
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.

#2:  Author: kolusuLocation: San Jose PostPosted: Thu Jul 27, 2006 8:14 pm
    —
jvlasvel,


Please check this link which explains in detail about the DISP processing

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B631/12.19.11?SHELF=&DT=20030423085347&CASE=

Quote:

My desire is to mod onto the dataset if it failed before and have it deleted upon completion of a good run.


huh ? what is the point of using this dataset.

Kolusu

#3:  Author: coolmanLocation: US PostPosted: Fri Jul 28, 2006 10:39 am
    —
Why not temp. datasets? They would anyway be deleted
________
Ford K?ln history


Last edited by coolman on Sat Feb 05, 2011 1:45 am; edited 1 time in total

#4:  Author: bablackLocation: Little Falls, NJ PostPosted: Fri Jul 28, 2006 12:06 pm
    —
>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.

#5:  Author: jvlasvel PostPosted: Fri Jul 28, 2006 12:19 pm
    —
Thanks for the responses.

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.

Thanks Again

#6:  Author: coolmanLocation: US PostPosted: Fri Jul 28, 2006 12:29 pm
    —
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

Hope this helps...
________
Toyota Land Cruiser 70 Series


Last edited by coolman on Sat Feb 05, 2011 1:45 am; edited 1 time in total

#7:  Author: bablackLocation: Little Falls, NJ PostPosted: Fri Jul 28, 2006 1:45 pm
    —
>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)

#8: Re: DISP=(MOD,PASS,CATLG) does not delete file after a clean Author: Steve CoalbranLocation: Stockholm, Sweden PostPosted: Thu Aug 17, 2006 8:02 am
    —
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?! Laughing

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)...
Code:

//SE16661S JOB (SDS,T,ZN,00),'STEVE',MSGCLASS=H,NOTIFY=&SYSUID,       
//         MSGLEVEL=(1,1),CLASS=A,TIME=(5,0)                           
//         SET D1='(NEW,PASS,CATLG)'                                   
//         SET D2='(MOD,PASS,CATLG)'                                   
//*--------------------------------------------------------------------
//CLEANUP  EXEC PGM=IEFBR14                                           
//EXISTS1  DD DISP=&D1,DSN=SE16661.IFTHEN.TEST1,SPACE=(TRK,1)         
//EXISTS2  DD DISP=&D2,DSN=SE16661.IFTHEN.TEST2,SPACE=(TRK,1)         
//                                                                     

The first gives as one would expect....
Code:

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                                     

Replacing the SET for D1 with...
Code:
//         SET D1=SHR

I then get NO errors ...
Code:

14.27.13 JOB14655  GSDMV20I JOBNAME- --STEP-- -PSTEP-- CCODE ELAPSED-TIME -CPU-T
14.27.13 JOB14655  GSDMV21I SE16661S CLEANUP               0     00:00:00      0
14.27.13 JOB14655  IEF404I SE16661S - ENDED - TIME=14.27.13       
...
and
...
IEF142I SE16661S CLEANUP - STEP WAS EXECUTED - COND CODE 0000                   
IGD104I SE16661.IFTHEN.TEST1                         RETAINED,  DDNAME=EXISTS1 
IEF373I STEP/CLEANUP /START 2006229.1427                                       
IEF374I STEP/CLEANUP /STOP  2006229.1427 CPU    0MIN 00.00SEC SRB    0MIN 00.00S
IGD104I SE16661.IFTHEN.TEST2                         RETAINED,  DDNAME=EXISTS2               

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! ).

Shocked /Steve Rolling Eyes



MVSFORUMS.com -> Job Control Language(JCL)


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group