MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DISP=(MOD,PASS,CATLG) does not delete file after a clean run

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
jvlasvel
Beginner


Joined: 27 Jul 2006
Posts: 2
Topics: 1

PostPosted: Thu Jul 27, 2006 5:59 pm    Post subject: DISP=(MOD,PASS,CATLG) does not delete file after a clean run Reply with quote

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.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Jul 27, 2006 8:14 pm    Post subject: Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Fri Jul 28, 2006 10:39 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
bablack
Beginner


Joined: 04 Dec 2002
Posts: 71
Topics: 0
Location: Little Falls, NJ

PostPosted: Fri Jul 28, 2006 12:06 pm    Post subject: Reply with quote

>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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jvlasvel
Beginner


Joined: 27 Jul 2006
Posts: 2
Topics: 1

PostPosted: Fri Jul 28, 2006 12:19 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Fri Jul 28, 2006 12:29 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
bablack
Beginner


Joined: 04 Dec 2002
Posts: 71
Topics: 0
Location: Little Falls, NJ

PostPosted: Fri Jul 28, 2006 1:45 pm    Post subject: Reply with quote

>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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Steve Coalbran
Beginner


Joined: 09 Mar 2005
Posts: 22
Topics: 0
Location: Stockholm, Sweden

PostPosted: Thu Aug 17, 2006 8:02 am    Post subject: Re: DISP=(MOD,PASS,CATLG) does not delete file after a clean Reply with quote

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
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group