Installed items
The necessary tools are installed along with a working example in the sub directory sample/audit under the isCOBOL installation directory. The folder is structured as follows:
The copy folder contains:
o audit.cpy: Copy of Procedure Division statements, contains the audit function
o audit.wrk: Copy of Working-Storage Section items, contains the audit variables
The data folder contains the JISAM files. This is the folder that the iscobol.file.prefix configuration variable points to.
The fdsl folder contains the FD and SL copybooks used by the audit feature:
o auditlog.sl and auditlog.fd describe the file that contains the audit information
o auditfilesettings.sl and auditfilesettings.fd describe the file that contains the audit settings for file operations
o auditlogsettings.sl and auditlogsettings.fd describe the file that contains the audit settings for user login/logout and the program execution information
The prg folder contains the compiled programs and tools.png, that is the image used by the AUDITSETTINGS program. This folder should be added either to the Classpath or to the iscobol.code_prefix.
The source folder contains the source code of the audit programs:
o AUDITLOG.cbl: This program writes the file's audit information into the auditlog file. Call this program in a thread at the startup of your program. The copybook called audit.cpy includes a paragraph that starts the audit thread and another paragraph that retrieves the information from the AuditTrigger program using the communication between threads.
o AUDITSETTINGS.cbl: A graphical program to configure the audit settings.
o AuditTrigger.cbl: The trigger program. This program checks the audit settings and sends the requested operation data thru a thread message to the AUDITLOG program. This COBOL program generates a lot of java classes. The classes of this kind of program must be placed into the Classpath. The code_prefix will not work for the trigger programs.
The AUDITSAMPLE.cbl program simulates your application. It shows how to start and stop the auditlog thread program, pass the name of the user to the audit program, load the audit settings from the file, trace the user login and logout, trace the start and the end of a program and call a cobol sub program.
IO-STATEMENTS.cbl is a sub program called by AUDITSAMPLE. This program will generate a data file called IndexedFile.
iscobol.properties is a configuration file that associates the file IndexedFile (the file generated by IO-STATEMENTS) to the AuditTrigger file handler.
Follow the instructions in the README file to compile the COBOL programs and have them ready to be used.