This routine sets the name of the runtime error file. Format specifiers may be used in the name. If the resulting file name differs from the current runtime error file name, the runtime closes the current error file, attempts to rename it to the new name, and opens the new file in extend mode. Subsequent error and trace messages are written to the new error file. Note that the rename operation overwrites an existing file. Also, the rename operation may fail if the original error file is in use by other runtime processes. In this case the original file will be left alone and the new file will start empty.




ERROR-FILE-NAME PIC X(n) Contains the name of the error file. The runtime error file format specifiers may be used.


This routine provides a means for applications to embed identifying information in the runtime error file name. For example, after a user logs in, an application can change the name of the runtime error file so that it includes the user name.

If the runtime fails and the user calls customer support, the support analyst can search the directory containing runtime error files and quickly identify the one with the user's name to help resolve the issue. This is especially useful in situations where the runtime was launched from AcuConnect using an entry in the AcuConnect alias file. Since one alias is used by many users, there is potentially only one error file. In this case, error messages tied to failures experienced by a particular user may be lost or difficult to read because multiple runtime processes are writing to the same error file. C$SETERRORFILE helps by allowing you to set the error file name from COBOL for a particular runtime instance.