isCOBOL Evolve : SDK User's Guide : Programming Guides : Audit : How to use the audit feature
How to use the audit feature
In order to activate the audit feature you create a separate thread that is responsible for logging the user activity on files according to the settings that you configured using the AUDITSETTINGS utility.
The necessary operations are provided in the audit.cpy copybook. You should include this copybook in your program and then invoke its paragraphs, as follows:
1. Start the thread in the AUDIT program:
perform START-AUDIT-LOG
2. Put the name of the user into the environment variable "userid", e.g.
move "MyUser"              to audit-user-logged
set environment "userid"   to audit-user-logged
3. Load the AUDIT settings into a table from the auditfilesettings file:
perform LOAD-AUDIT-SETTINGS
4. Register the logon of the user according to the audit settings:
perform REGISTER-LOGIN
5. Register the start of the execution of a COBOL program according to the audit settings:
move "YourProgramName" to audit-prg-to-launch
perform REGISTER-PGM-START
6. Call your COBOL program:
call audit-prg-to-launch
7. Register the end of the execution of a COBOL program according to the audit settings:
perform REGISTER-PGM-END
8. Register the logout of the user according to the audit settings:
perform REGISTER-LOGOUT
9. Stop the execution of the thread of the auditing process:
perform STOP-AUDIT-LOG