# Mainframe Logger - Samples

Substation ES and Mainframe RED are shipped with the samples that demonstrate how the TIBCO Mainframe Logger writes information to IBM z/OS System Logger Streams. You can write information from any COBOL, C, or LE assembler programs. The programs can vary from environments such as the normal IBM z/OS batch, CICS, or IMS.

## Samples Overview

All programs are bound with a STUB module SXL3WLOG located in the `USERHLQ.LIBRARY` which at run-time will call the DLL TIB3WLOG located in the `USERHLQ.LOAD`. Ensure this module is available with the program during run-time.

Your application program should supply:

- the message data area address
- the length of the data
- a message Id

After calling the TIB_WRITE_SYSLOG function, your program should check the return code and the reason when supplied.

Return Code | Meaning
--- | ---
0 | Normal. All messages written to log
8 | HUB is inactive
12 | HUB returned error in writing log record stream
16 | Reason = 1, TIBDWLOG parameter object address not present (NULL pointer) Reason = 2, data pointer in TIBDWLOG is zero (NULL) Reason = 3, data length in TIBDWLOG is zero
20 | Invalid request - check Write2 value

The following actions are carried out by TIB3WLOG DLL:

- Determine which Mainframe HUB to use. If a HUB name is not supplied in the program, the HUBxxx DD name is used for the environment your are executing in. If that is not available, it will use the SMF Id of the LPAR that you are running on.
- Call a PC routine to enable writing to the appropriate IBM z/OS stream.

Copyright © TIBCO Software Inc. All rights reserved.