I was referring to adding a try catch block around the call statement that may cause the RTS 173 to occur or some other run-time error that occurs within the same program in which the file has been opened. This way you can trap the exception instead of allowing it to be propagated up to the aspx level. You could reraise the exception after you closed the file in order to pass it back to the aspx level. open output test-file try call next-prog catch ex as type Exception display ex::Message close test-file * raise ex end-try display "after call" If you are calling COBOL programs within a multithreaded web app that uses a thread pool then you must use RunUnits or the programs will not be thread safe. Each thread will share the same data, database connections, files etc. Creating a RunUnit isolates these threads from each other. Evan if you are calling a COBOL object program, if you are using database connections, file hander or RTS system calls then you also need to place this within a RunUnit. Only the top level program that is being called needs to be added to a rununit. Any programs that it calls will automatically be part of the same rununit. In this way multiple threads can each have their own copy of the program and its resources.
↧