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
 

 

Error writing to KSDS - Error Code 48

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Error writing to KSDS - Error Code 48
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    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 21, 2011 11:04 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 21, 2011 7:15 pm    Post subject:
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    Post subject:
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: 7906
Location: Bellevue, IA

PostPosted: Fri Jul 29, 2011 4:11 am    Post subject:
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    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
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 3 Mon Dec 05, 2016 11:57 am
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm


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