View previous topic :: View next topic
|
Author |
Message |
kvamsy
New User
Joined: 14 Apr 2009 Posts: 10 Location: chennai
|
|
|
|
Cobol statement as mentioned below is correct or not?
READ XX-FILE NEXT
AT END MOVE "Y" TO WF-EOF-XXFILE-FLAG.
XX-file is opened as input mode, and giving error as below,
"ERROR READING XXFILE STATUS CODE: 46 "
Please help to sort this out? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Did you look up the 46 file status? What did you try to fix it? The COBOL statement as coded is perfectly valid -- but may or may not work, depending on how the rest of the code is written. |
|
Back to top |
|
|
kvamsy
New User
Joined: 14 Apr 2009 Posts: 10 Location: chennai
|
|
|
|
I haven't tried anything because I don't know how to clear that one, Program flows like this
1)Opening a file with input mode,
2)cheking the statment as mentioned earlier
3) whether the file status is good or EOF continue
Else
Giving error status code as 46 , In the whole program I am using only one time read of XX-file ,
file declared as below
SELECT XX-FILE
ASSIGN TO ASEXTI01
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS NDX2-KEY-XX
FILE STATUS IS FILE-STATUS-DB
FILE-STATUS-DB-VSAM |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The 46 file status means
Quote: |
A sequential READ statement was
attempted on a file open in the input
or I-O mode and no valid next record
had been established because:
1. The preceding READ statement was
unsuccessful but did not cause an
at end condition
2. The preceding READ statement caused
an at end condition. |
Since the file is dynamically accessed, how did you establish the current record pointer BEFORE using the READ NEXT statement? READ NEXT is only valid when you've done a START or READ on the file already -- you cannot use it until then. |
|
Back to top |
|
|
kvamsy
New User
Joined: 14 Apr 2009 Posts: 10 Location: chennai
|
|
|
|
When we use this Rad next it will read from Next, Initially we have a low value record. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Initially we have a low value record. |
How do you know this? Did you initialize the buffer? Do you have the LE run time option set to initialize storage? If neither of these is true, then you need to be aware that memory will not necessarily be initialized to LOW-VALUES. And what, by the way, does memory value have to do with setting the current record pointer for the READ NEXT in the VSAM file? |
|
Back to top |
|
|
|