LOG call

The Log (LOG) call is used to send and write information to the IMS™ system log.

Format

Read syntax diagramSkip visual syntax diagram
>>-LOG--+-i/o pcb-+--i/o area----------------------------------><
        '-aib-----'             

Call Name DB/DC DBCTL DCCTL DB Batch TM Batch
LOG X X X X X

Parameters

i/o pcb
Specifies the address of the PCB, the first PCB address in the list passed to the program, to use for this call. This parameter is an input and output parameter.
aib
Specifies the application interface block (AIB) that is used for the call. This parameter is an input and output parameter.
The following fields must be initialized in the AIB:
AIBID
Eye catcher. This 8-byte field must contain DFSAIBbb.
AIBLEN
AIB lengths. This field must contain the actual length of the AIB that the application program obtained.
AIBRSNM1
Resource name. This 8-byte, left-justified field must contain the PCB name IOPCBbbb.
AIBOALEN
I/O area length. This field must contain the length of the I/O area that is specified in the call list.
i/o area
Specifies the area in your program that contains the record that you want to write to the system log. This parameter is an input parameter. This record must be in the format shown in the following tables.
Table 1. Log record formats for COBOL, PL/I, C language, Pascal, and assembler for AIBTDLI, ASMTDLI, CBLTDLI, CEETDLI, CTDLI, and PASTDLI interfaces
Field Name Field Length
LL 2
ZZ 2
C 1
Text Variable
Table 2. Log record formats for COBOL, PL/I, C language, Pascal, and assembler for PLITDLI interface
Field Name Field Length
LLLL 4
ZZ 2
C 1
Text Variable
The fields must be as follows:
LL or LLLL
Specifies a 2-byte field that contains the length of the record. When you use the AIBTDLI interface, the length of the record is equal to LL + ZZ + C + text of the record. For the PLITDLI interface, the length of the record is equal to LLLL + ZZ + C + the text of the record. When you calculate the length of the log record, you must account for all of the fields. The total length you specify includes:
  • 2 bytes for LL or LLLL. (For PL/I, include the length as 2, even though LLLL is a 4-byte field.)
  • 2 bytes for the ZZ field.
  • 1 byte for the C field.
  • n bytes for the length of the record itself.

If you are using the PLITDLI interface, your program must define the length field as a binary fullword.

ZZ
Specifies a 2-byte field of binary zeros.
C
Specifies a 1-byte field containing a log code, which must be equal to or greater than X'A0'.
Text
Specifies any data to be logged.

Usage

An application program can write a record to the system log by issuing the LOG call. When you issue the LOG call, you specify the I/O area that contains the record you want written to the system log. You can write any information to the log, and you can use log codes to distinguish among various types of information. You can issue the LOG:

  • In the IMS DB/DC environment, and the record is written to the IMS log.
  • In the DCCTL environment, and the record is written to the DCCTL log.

Restrictions

The length of the I/O area (including all fields) cannot be larger than the logical record length (LRECL) for the system log data set minus 4 bytes and the length of logrec prefix (which is x'4A' bytes in length), or the I/O area specified in the IOASIZE keyword of the PSBGEN statement of the PSB.