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

ERROR Status code 46


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

New User


Joined: 14 Apr 2009
Posts: 10
Location: chennai

PostPosted: Wed May 06, 2009 3:26 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed May 06, 2009 3:32 pm
Reply with quote

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
View user's profile Send private message
kvamsy

New User


Joined: 14 Apr 2009
Posts: 10
Location: chennai

PostPosted: Wed May 06, 2009 3:39 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed May 06, 2009 3:51 pm
Reply with quote

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
View user's profile Send private message
kvamsy

New User


Joined: 14 Apr 2009
Posts: 10
Location: chennai

PostPosted: Wed May 06, 2009 4:06 pm
Reply with quote

When we use this Rad next it will read from Next, Initially we have a low value record.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed May 06, 2009 4:19 pm
Reply with quote

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
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 Job completes in JES, but the status ... IBM Tools 1
Search our Forums:

Back to Top