dharmendra_kp New User Joined: 10 Mar 2005 Posts: 33 Location: Lewiston
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?
Asif Iqbal New User Joined: 17 May 2005 Posts: 27 Location: Pune, India.
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)
dick scherrer Site Director Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
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. . . .
All times are GMT + 6 Hours