View previous topic :: View next topic
|
Author |
Message |
mahendrakariya
New User
Joined: 21 Jun 2011 Posts: 7 Location: India
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
mahendrakariya
New User
Joined: 21 Jun 2011 Posts: 7 Location: India
|
|
|
|
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 |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
It clearly says... The file is not opened in IO or Output mode... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
But that is not the case... |
This is your belief . . .
The system knows otherwise.
I believe the system. . . |
|
Back to top |
|
|
mahendrakariya
New User
Joined: 21 Jun 2011 Posts: 7 Location: India
|
|
|
|
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 |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
System says error code = 48 --> File not opened in IO mode. Have you opened the file in the proper mode? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Did you test the file stat after your OPEN? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|