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!

Run-Time Error 146(No current record defined)

Status
Not open for further replies.

chitownjoe

Programmer
Mar 27, 2001
5
US
Purpose of the program is to;
1)READ INPUT FILE
2)EXTRACT CERTAIN RECORDS TO OUT-FILE
3)ADD CERTAIN RECORDS TO WORK-FILE
4)SORT WORK FILE GIVING OUT2-FILE
5)READ/SUMMARIZE OUT2-FILE
6)REREAD OUT2-FILE APPENDING TO OUT-FILE

Program takes in 1 input file, sorts it on 4 keys,
utilizing USING/GIVING format. The output of the sort(GIVING)
is then needed to be reread, to be appended to original
output file. Problem is on reread, I get the above run-time
error. It basically is starting at the end of the file.
Problem is the file does not start the same way each time.
How do I fix this?, what would I key on? - CHITOWNJOE
 
Hi Joe,

You don't show the code, so it's difficult to generalize. But some areas to look at are:

Do you open out2-file after the sort?
Do you close it after the summerize?
Do you open it again to append it to out-file?
Do you close out-file after extract and open w/extend?
Have you considered using SORT I/O Procedures?

Maybe you can show the code w/only the main logic and I/O.

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top