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

Error writing to KSDS - Error Code 48


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

New User


Joined: 21 Jun 2011
Posts: 7
Location: India

PostPosted: Thu Jul 21, 2011 10:31 am
Reply with quote

Hi,

I am trying to write to a KSDS file. I am getting file status 48. How to solve the problem ? My code snippets are as follows.

Code:

SELECT LOANFILE
       ASSIGN TO LFILE
       ACCESS MODE  IS RANDOM
       ORGANIZATION IS INDEXED
       RECORD KEY   IS LN-KEY
       FILE STATUS  IS FS-LOAN.


FS-LOAN is defined as follows.

Code:

01 FS-LOAN  PIC X(2).
     88 LSUCCESS                  VALUE '00'.
     88 LDUPKEY                   VALUE '02'.
     88 LEOF                      VALUE '10'.
     88 LDUPREC                   VALUE '22'.
     88 LNOREC                    VALUE '23'.


FD entry for LOANFILE has a group record LOANREC for writing to this file.

Code:

WRITE LOANREC.
IF LSUCCESS
   CONTINUE
ELSE
   PERFORM ERR_PROCESSING
END-IF.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 21, 2011 10:35 am
Reply with quote

how about you read about a file status 48 here and tell us what you have decided to do in order to correct the problem.
Back to top
View user's profile Send private message
mahendrakariya

New User


Joined: 21 Jun 2011
Posts: 7
Location: India

PostPosted: Thu Jul 21, 2011 10:40 am
Reply with quote

I displayed FS-LOAN which showed 48.

I googled for this error code. It generally occurs when we try to write a file which is not open in IO or OUTPUT mode.

But that is not the case...

So where exactly is the error ? I dont know !!!
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 21, 2011 10:52 am
Reply with quote

It clearly says... The file is not opened in IO or Output mode...
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 Jul 21, 2011 11:04 am
Reply with quote

Hello,

Quote:
But that is not the case...
This is your belief . . .

The system knows otherwise.

I believe the system. . .
Back to top
View user's profile Send private message
mahendrakariya

New User


Joined: 21 Jun 2011
Posts: 7
Location: India

PostPosted: Thu Jul 21, 2011 11:10 am
Reply with quote

Quote:

This is your belief . . .

The system knows otherwise.


So what does the system believe? How to find out the system belief?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 21, 2011 11:18 am
Reply with quote

System says error code = 48 --> File not opened in IO mode. Have you opened the file in the proper mode?
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 Jul 21, 2011 7:15 pm
Reply with quote

Hello,

Has the file already been closed? Was there any other error (not checked) that could have occured while processing?

Is the code processing where it should not be?

We have no way to check your code as we have no login to your system, but it should not be too difficult to track down what is happeining with this file. . .
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Jul 29, 2011 4:01 am
Reply with quote

Did you test the file stat after your OPEN?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 29, 2011 4:11 am
Reply with quote

If your OPEN failed -- as in giving any file status code other than 00 or 97, then your WRITE would get a 48 file status code.

You should also use the extended file status codes to get the VSAM feedback, return, and reason codes to assist in debugging problems. Of course, they are not needed in this case since the problem is very obvious -- the OPEN failed, you did not check for a good open of the file, then attempted to write to a file not open in I-O or OUTPUT mode.
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 Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top