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

Difference between DISP=OLD and DISP=MOD


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
reena_preethi

New User


Joined: 14 Jun 2006
Posts: 14

PostPosted: Tue Jun 20, 2006 6:21 pm
Reply with quote

this question was asked in TCS.

what is difference between disp=(old,delete,delete),disp=(mod,delete,delete)
what is process is going to happen when you mention this.

weather both record going to be delete or not? can anybody answer this question.

DISP=OLD vs DISP=MOD

thanks in advance

regards
reena
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jun 20, 2006 6:30 pm
Reply with quote

Setup a test job with one step to allocate a dataset.

First, run the job with DISP=(OLD,DELETE,DELETE). What happens?
Next, run the job with DISP=(MOD,DELETE,DELETE). What happens?

Now, allocate and catalog the dataset first. Then, try the same job again.

Run the job with DISP=(OLD,DELETE,DELETE). What happens?

Now, allocate and catalog the dataset first. Then, try the same job again.

Run the job with DISP=(MOD,DELETE,DELETE). What happens?
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Tue Jun 20, 2006 6:49 pm
Reply with quote

DISP=(PART1,PART2,PART3)

PART1 can be OLD - file must exist and you have exclusive control of the dataset, that is, nobody else can read the file while you are using it.
PART1 can be SHR - file must exist and all others may READ it at the same time you are reading it (they must have SHR as well)
PART1 can be MOD - file must exist and you will be adding on to the end of the file.
PART1 can be NEW - you are creating the file for the 1st time.

PART2 can be KEEP - This would assume the dataset is already catalogued and would probably be used with DISP=(OLD,KEEP)
PART2 can be CATLG - This would assume the dataset is new and once the job step ends that created the dataset, it would be catalogued.
PART2 can be DELETE - This would mean the dataset would be deleted after the job step ends.
PART2 can be PASS - This would usually be used with creating a temporary datasets so it can be passed and read in to subsequent steps.
PART2 can be UNCATLG - Rarely used.

When PART3 is coded, it tells the system what to do with your dataset in the event your job abnormally terminates.
PART3 can be KEEP - This would assume the dataset is already catalogued and the dataset would kept after an abnormal termination.
PART3 can be CATLG - This would assume the dataset is new and if the job step abnormally terminates, it would be catalogued.
PART3 can be DELETE - This would mean the dataset would be deleted in the event of an abnormal termination.
PART3 can be UNCATLG - Rarely used.

So DISP=(OLD,DELETE,DELETE) means READ an existing dataset and delete the dataset at the end the job step, regardless of whether the step abnormally terminated or not.
DISP=(MOD,DELETE,DELETE) means write to the end of an existing dataset and delete the dataset at the end the job step, regardless of whether the step abnormally terminated or not. This disposition doesn't make alot of sense, because why would you want to delete a dataset you just mod'ed onto.
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Tue Jun 20, 2006 8:42 pm
Reply with quote

Hi ,

if dataset is already cataloged
then no difference b/w disp=(old,delete,delete) and disp=(mod,delete,delete).
step runs successfully with same results(dataset deleted)

but if dataset not present then

disp=(old,delete,delete)
this will give JCL Error .

disp=(mod,delete,delete)
this will run successfully .

I haven't tested this but i think this is the main difference .

plz chk out
n do tell me if i m wrong .

Thanks ,
Kapil .
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Fri May 04, 2007 3:06 pm
Reply with quote

If FIle is present and :
Disp=(OLD,DELETE,DELETE) - job will fail with JCL error

&
Disp=(MOD,DELETE,DELETE) - job will execute succesfully as MOD will create that file( for this we give SPACE parameter)
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 04, 2007 3:13 pm
Reply with quote

Quote:

If FIle is present and :
Disp=(OLD,DELETE,DELETE) - job will fail with JCL error


I think maybe you meant to say if the file was not present
Back to top
View user's profile Send private message
anandhan.e

New User


Joined: 12 Apr 2006
Posts: 1
Location: chennai

PostPosted: Sat May 05, 2007 11:12 pm
Reply with quote

If FIle is NOT present and :
Disp=(OLD,DELETE,DELETE) - job will fail with JCL error
If FIle is present and :
Disp=(OLD,DELETE,DELETE) - job will run, file deleted

&
If FIle is NOT present
Disp=(MOD,DELETE,DELETE) - job will execute succesfully as MOD will create that file( for this we give SPACE parameter)
If FIle is NOT present
Disp=(MOD,DELETE,DELETE) with out SPACE parameter- job will fail with JCL error
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts What is the difference between Taskty... Compuware & Other Tools 2
No new posts Difference between VALIDPROC and CHEC... DB2 3
No new posts Difference between CEE3250C and CEE3204S COBOL Programming 2
Search our Forums:

Back to Top