Our application is a collection of originally Unisys mainframe tasks (IBM jobs) that over the last 18 years we have converted to Object COBOL, then Net Express, and finally Visual COBOL 2.3 for VS 2013 Update 1. Each task consists of an .exe using a Screen Section and DISPLAY/ACCEPT to input run parameters calling a number of .dlls and passing the run parameters through a Linkage Section. Every task is executed from a single parameterized .bat file that, among other things, sets the console redirection switch and appends all program DISPLAY output to a log file. This gives us a record of everything that happens in a run.
We are converting this application from native console/libraries to web-accessible ASPXs in #C (replacing the .exes) and managed COBOL (replacing the .dlls) The ASPX program starts the log file by writing some initial info and then closes the file. Each called COBOL program then opens the log file in EXTEND mode, writes (DISPLAYs have been converted to WRITEs)its messages as it processes, and closes the file before returning. The ASPX program appends some closing info after the last COBOL program returns.
Our problem is when there is a Run Time error in a COBOL program ("file not found" for example). We are getting the error info back in the ASPX program, but the log file is still locked (by the terminated COBOL program?) and can't be opened to add the error info. The only way to unlock the file is to restart the application in IIS.
Anybody got any ideas on another, programmable way by which we can get the log file unlocked?
Or even better, how to guarantee any file open at the time of a Run Time Error will be closed/unlocked when the COBOL program has been left?
↧