Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COBOL I/O ERROR 46

Status
Not open for further replies.

modnar

Programmer
Mar 31, 2001
4
US
I suddenly started getting that error with an INPUT file I'm using. The file is there and has the correct name and everything. This error pretty much appeared out of the blue, and I have no idea what it means.

Can anyone help?

Thanks in advance!
 
Hi Mo,

It means that your prev read did not complete properly.
Genearally, it's caused by attempting a read after EOF.

Are you a pgmmr or a student? I you're a pgmmr you should have the manuals available to get this kind of info; if you're a student ask your prof if he has and where he keeps the manuals.

Good luck, Jack.
 
Jack,

Thanks for your help. I am a student. I was trying to find some manuals on line, but woe is me. :)

I'm still confused, though. The program reads two files that are almost identical and reads them in the exact same way at the exact same time. Why would it decided to crap out on this one file?

I have some experience in C++ and Perl, but this error is making me pull my hair out. :)

Thanks again,
Modnar
 
Let me see if I can make my question more specific.

Is it a problem with the program or the file I'm reading. I have tried recreating the file and even using the exact same file that the program reads fine.

There are no warnings or errors when the program compiles, but that doesn't necessarily mean anything.

Thanks,
Modnar
 
IF READ-OLD = 'Y'
READ OLD-FILE
AT END MOVE HIGH-VALUES TO ACCOUNT-O
END-READ
END-IF
IF READ-TRANS = 'Y'
READ TRANS-FILE
AT END MOVE HIGH-VALUES TO ACCOUNT-T
END-READ
END-IF

The error occurs when I try to read OLD-FILE. However, if I switch the two almost identical sections of the code, the error will occur on TRANS-FILE.
 
Hi Mo,

The best thing to do is to cut&paste your code into your post. I can't get any insight into what might be happening from what you provided.

Be sure to "wrap" your code in delimiters, e.g.,

[*code]
paste your code here
.
.
[*/code]

Don't use the "*". If I didn't include them the system would think I was trying to include program code. You can press the "Preview Post" button and that will show you what your post will look like (wysiwyg). Immediately after your wysiwyg code, it will also show you a list of features you can use in posting.

Jack

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top