View previous topic :: View next topic
|
Author |
Message |
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
whenever there is a DCB parameter mismatch in a file, we get the return code 39 while opening the file in the program. whereas, if we try to close a file which is not in the open state, we get the return code as 42.
in my program, due to some logical errors i issued a CLOSE on a file which was not in open mode. also that file was having a DCB parameter mismatch.
i was expecting a return code 42, whereas i am getting 39. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Compiler checks for the FD entries first & then would go for any I/O operation on the file. Because FD & DCB doesn't match & they were checked first, status-code 39 comes in.
P.S.: I'm not very sure about the above, let's wait for some other comment. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Create a new little program with the same select and fd for the problem file. Make sure you keep the dcb mis-match.
In the procedure division, issue a close for the file - nothing else for the file. Display what the file status code is. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
hi dick,
actually i already tried that and i am getting the same result as 39.
as anuj said, first of all the compiler is checking the FD entries and there itself it is giving the error.
however, if i dont perform any operation on that file, then the program runs fine. if what anuj said was entirely correct then i should have got the same 39 in that case also. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
if i dont perform any operation on that file, then the program runs fine. if what anuj said was entirely correct then i should have got the same 39 in that case also |
I don't believe so. . .
If there are no operations performed on the file, there would be no error. The system would not know about the mismatch if nothing was issued to use the file. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
i think u didnt get me.
when i am not performing any operation on that file, the program is running fine. however, when i am issuing a close on that file, i am getting 39. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yes, i believe i do understand.
If you "do nothing" with the file, you will not get an abend.
The close (when the file had not been opened) triggered the dcb conflict error rather than the close error that you expect/prefer.
When you correct both problems, all of the errors will go away and it will not be an issue. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
thanks for the explanation dick.
i was confused coz the manuals said that the OPEN statement on a file with DCB parameter mismatch will throw 39. however, i was getting it for CLOSE. |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
Really good Basic Stuff.. Thanks Anuj and Dick for sharing ur views.
Thanks gautam for ur basic good post.. |
|
Back to top |
|
|
sandip_mainframe Warnings : 2 New User
Joined: 20 Sep 2006 Posts: 63 Location: pune
|
|
|
|
Hi Gautam,
While executing program it first checks file division if any mismatch is there it generates error code 39 and not 42.
Thanks
Sandip V Walsinge |
|
Back to top |
|
|
|