View previous topic :: View next topic
|
Author |
Message |
dharmendra_kp
New User
Joined: 10 Mar 2005 Posts: 33 Location: Lewiston
|
|
|
|
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 |
|
|
Asif Iqbal
New User
Joined: 17 May 2005 Posts: 27 Location: Pune, India.
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|