Title: Starting a new trace log file for the current run unit

isCOBOL has a feature that will enable you to start a new trace log for the current run unit.

When a COBOL program sets "iscobol.logfile" using SET ENVIRONMENT the isCOBOL framework will close the current log and open the new one for the current run unit.

For example, suppose you want to have a separate trace log file for each user in an application server environment. To separate log files you could add the following code:

           STRING "MYAPP_" 
             USER-ID DELIMITED BY SPACE 
             ".log" INTO LOGFILE-NAME.
           SET ENVIRONMENT "logfile" TO LOGFILE-NAME.

If USER-ID is 1234 then the above code will cause isCOBOL to close the current log file if any and open a new log named MYAPP_1234.log.

The above assumes you have a variable in working storage similar to the following:

       01 LOGFILE-NAME PIC X ANY LENGTH.

Authored by: Veryant Support on Tue, Jul 6th, 2010 at 7:00 PM
This question has been viewed 7626 times so far.
Online URL: http://support.veryant.com/support/phpkb/question.php?ID=134

Powered by PHPKB Knowledge Base Software