Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Difference between DISP=OLD and DISP=MOD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Difference between DISP=OLD and DISP=MOD
Reply with quote

this question was asked inTCS.
what is difference between disp=(old,delete,delete),disp=(mod,delete,delete) what is process is going to happen when you mension this. weather both record going to be delete or not? can anybody answer this question.

thanks in advance

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

superk

Moderator Team Head


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

PostPosted: Tue Jun 20, 2006 6:30 pm    Post subject: Re: interview question
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    Post subject: Re: interview question
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    Post subject: Re: Difference between DISP=OLD and DISP=MOD
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri May 04, 2007 3:13 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us