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

DISP for updatable dataset


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dharmendra_kp

New User


Joined: 10 Mar 2005
Posts: 33
Location: Lewiston

PostPosted: Thu Dec 14, 2006 4:35 pm
Reply with quote

Hi all,
Can we open a dataset in OUTPUT mode from COBOL pgm with DISP=SHR, in run step?
Have found a pgm having to open statements in same pgm once in INPUT mode & once in OUTPUT mode with DISP=SHR, running perfectelly fine.
Or is it shop or COBOL verssion dependent dependent?
Back to top
View user's profile Send private message
Asif Iqbal

New User


Joined: 17 May 2005
Posts: 27
Location: Pune, India.

PostPosted: Thu Dec 14, 2006 5:01 pm
Reply with quote

Hi Dharmendra,

DISP=SHR works fine with OPEN OUTPUT.

The only thing is that all the data present in the dataset will be destroyed and the dataset would be written afresh.

I think in ur program, the file is first read (OPEN INPUT)-then closed-then rewritten from scratch(OPEN-OUTPUT)


Thanks,
Asif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Dec 14, 2006 8:08 pm
Reply with quote

Hello,

If you are writing all "new" data into the file, you should use DISP=OLD.

The old IBM phrase "the results may be unpredictable" could apply here.

Is it possible that SHR was used to get around the problem of the dataset alaready being in use? If so, that should be resolved - not just bypassed.

One other thought is that, if you are destroying the existing data, the step cannot be restarted as the input wil no longer exist. . . .
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top