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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FILE ALREADY OPEN-CANNOT OPEN FILE

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I WAS WORKING ON A PROGRAM FOR MY CLASS AND I WAS RUNNING TO SEE IF IT WORKS. AFTER RUNNING IT A COUPLE OF TIMES AND FIXING MINOR GLITCHES. I GOT THE ERROR IN THE SUBJECT LINE. DOES ANYONE HAVE ANY SUGGESTIONS.

THANKS
 
Hi,

some possibilities:

1) program logic error: do you realy open it for the 2nd time? It is easy to check with a debugger

2) A previous run let the file in a kind of open mode. You need a kind of 'verify' tool to get it all right again.

3) If you can afford it, try to build the file again...

Perhaps you can show your program here and tell us what compiler you are using....

Success!
 
Most likely you opened the file previously within the program somewhere. However, if you have a program that uses the same file and it is being run as a previous job step within a PROC or procedure, and that step abends it can leave the file opened. If you are using IBM COBOL on a mainframe there is a utility called IEFBR14. It can be used to reset or close the file if a previous step using the file abends. It can be run conditionally or just run. If the file is closed it does nothing. If it is still opened it will close it. Set the disposition of the file to (OLD, KEEP,KEEP) in the IEFBR14 job step.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top