# TIBCO z/OS Logging API

TIBCO provides API call to facilitate an application to log (write data) to a z/OS System Logger Data Stream.

This section describes the concepts and details of the TIBCO z/OS Log API call. To code this API call in Assembler, C, COBOL, Fortran or PL/I on LE, follow the rules of the individual language for making calls to the API.

Use the following API writes to log or trace to a z/OS System Logger Data Stream. The API use the z/OS function IXGWRITE but to different stream names.

The APIs can be found in Substation ES library PDSE.

- For LE programs use: USERHLQ.library(SXGAWLOG).
- For NON-LE program use:USERHLQ.library(SXGFWLOG)

When an application uses API, include above object in the binder step during compilation.

## SXGAWLOG

SXGAWLOG library writes data to a z/OS System Logger Data Stream for logging and tracing.

It works in the following manner:

1. The program is used to create the logger record structure (ie. DATA)
2. The program calls SXGAWLOG with appropriate parameters.
3. SXGAWLOG determines which entry point was used.
   1. It finds the matching HUB name running on the LPAR.
      - In case no match is found, it displays return code 12 and reason code 8101.
   2. It calls the HUB process for logging.
   3. If the HUB has logging setup, then the message is written. Otherwise, an error message is displayed.
   4. After the z/OS stream write, the HUB returns the RC return code and REASON code to SXGAWLOG, which in turn returns the values to the caller.
4. Each call to SXGAWLOG is a standalone request. The HUB value can be the same or different between calls.
5. The SXGAWLOG is a synchronous call.

COBOL Call

    CALL "SXGAWLOG"
         USING BY REFERENCE HUB-NAME,
               BY REFERENCE WS-TYPE,
               BY REFERENCE WS-LOGREC,
               BY REFERENCE WS-REASON,
               RETURNING    WS-RETURN
    END-CALL.

C Declaration

    int SXGAWLOG(
         char      *HUB,
         char      *TYPE,
         void      *LOGREC,
         int       *REASON);

Copyright © TIBCO Software Inc. All rights reserved.