Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Confused between file status.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Confused between file status.
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

Senior Member


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

PostPosted: Thu Mar 27, 2008 11:30 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Mar 27, 2008 11:32 pm    Post subject: Confused between file status.
Reply with quote

Click on the following -

http://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

Site Director


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

PostPosted: Thu Mar 27, 2008 11:37 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Mar 28, 2008 12:49 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Mar 28, 2008 7:26 am    Post subject:
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    Post subject:
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: 216
Location: India

PostPosted: Fri Mar 28, 2008 12:19 pm    Post subject: Reply to: Confused between file status.
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: 61
Location: pune

PostPosted: Fri Mar 28, 2008 2:26 pm    Post subject: Reply to: Confused between file status.
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us