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

Confused between file status.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Thu Mar 27, 2008 11:20 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 27, 2008 11:30 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Mar 27, 2008 11:32 pm
Reply with quote

Click on the following -

publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/igy3lr00/6.1.8.9.1?SHELF=igy3sh00&DT=20011206182158#HDRSTATKEY

Bill
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 Mar 27, 2008 11:37 pm
Reply with quote

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
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Thu Mar 27, 2008 11:49 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Mar 28, 2008 12:49 am
Reply with quote

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
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Fri Mar 28, 2008 7:20 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Mar 28, 2008 7:26 am
Reply with quote

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
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Fri Mar 28, 2008 8:09 am
Reply with quote

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
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri Mar 28, 2008 12:19 pm
Reply with quote

Really good Basic Stuff.. Thanks Anuj and Dick for sharing ur views.
Thanks gautam for ur basic good post..
Back to top
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Fri Mar 28, 2008 2:26 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top