SysLib.audit( record anyBasicRecord in [, jid SMALLINT in ])
The first 2 bytes contain the length of the record to be written. The next 2 bytes contain a code that you specify to identify the source of the journal record, and the first byte of that code must be in the range X'A0' to X'FF'.
In addition to containing the record length and record identifier code, the first 28 bytes are reserved for system usage and should not contain user data. Bytes 29 to 32767 are available for audit data.
SysVar.errorCode receives one of the status codes in the next table if you enclose SysLib.audit in a try...end block or if you are in VisualAge® Generator compatibility mode and VGVar.handleSysLibraryErrors is set to 1.
Value in SysVar.errorCode | Description |
---|---|
00000000 | Successful completion |
00000201 | Length error |
00000202 | User source code error |
00000204 | Journal identifier error |
00000803 | I/O error |
If portability between CICS and non-CICS environments is required, you can develop a non-EGL program with the same name as the system function (audit) to receive the service call in non-CICS environments. When generating for an environment in which the service is not supported, the generator turns the function call into a call to the program with the same name. Alternatively, if the service is not supported in the non-CICS environment, you can test the value of SysVar.sysType to determine the runtime environment, then invoke SysLib.audit() only if you are running in CICS.
The record is automatically converted to IMS log format when EGL adds 2 to the length and inserts 2 bytes of binary zeros following the length field. Only the first byte of the record identifier code is used. The second byte of the record identifier code is ignored. The jid parameter is ignored. IMS/VS has a maximum limit of 32765 bytes.
move 32765 to wrkrec.length; move "A" to wrkrec.code; move 2 to jrnlid; move "THIS IS THE DATA TO BE WRITTEN TO JOURNAL NUMBER 2" to wrkrec.data; SysLib.audit(wrkrec, jrnlid);
Related concepts
Syntax diagram for EGL functions
Related reference
asynchLink element
EGL library SysLib
errorCode
printerAssociation
transfer