Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 4 Examples : COBOL Samples of Tracker Event Client

COBOL Samples of Tracker Event Client
This section contains examples of how to send an Unsolicited Alert message and a Notification message written in the COBOL programming language.
Unsolicited Alert Message
 
The following sample illustrates how to send an Unsolicited Alert message to Hawk or Mainframe WebUI through a Tracker Server subsystem with an API call. The full version of the batch program is userhlq.COB(SXKCNUEV) and the CICS online program is userhlq.COB(SXKCCUEV).

 
* Information passed from the parameters
* Subsystem to communicate with
* Error message pointer return from the API call
   01  SXK-BASE.
       05  WS-SSID            PIC X(4)   VALUE 'SXK1'.
       05  ERROR-MSG-POINTER  USAGE POINTER.
 
* Tracker Request Copybook
 COPY SXKCCMSG.
 
* Set request type
* Set request message id
* Set message text
   MOVE SXK-REQ-ALERT-ID      TO SXK-ALERT-REQUEST-ID.
   MOVE 'SXK9999I'            TO SXK-ALERT-MSG-ID.
   MOVE ' A Test Message'     TO SXK-ALERT-DATA.
 
* Compute length which is message size plus 12
   COMPUTE SXK-ALERT-SEG-LEN = 15 + 12.
   SET ERROR-MSG-POINTER TO NULL.
 
* Call Tracker interface routine
   CALL 'SXKADSSI'
     USING BY REFERENCE  WS-SSID,
           BY REFERENCE  SXK-ALERT-REQUEST,
           BY VALUE      SXK-FUNCTION-ID,
           RETURNING     ERROR-MSG-POINTER
   END-CALL.
 
* See if there is an error message returned
   IF ERROR-MSG-POINTER NOT = NULL
     PERFORM 850-ON-CALL-ERROR
   END-IF.

 
Notification Message
The following sample illustrates how to send a Notification message to Hawk or Mainframe WebUI through a Tracker Server subsystem with an API call. The full version of the batch program is userhlq.COB(SXKCNUEV) and the CICS online program is userhlq.COB(SXKCCUEV).

 
* Information passed from the parameters
* Subsystem to communicate with
* Error message pointer return from the API call
   01  SXK-BASE.
       05  WS-SSID           PIC X(4)   VALUE 'SXK1'.
       05  ERROR-MSG-POINTER USAGE POINTER.
 
* Tracker Request Copybook
 COPY SXKCCMSG.
 
* Set request type
* Set request message id and others
* Set message text
   MOVE SXK-REQ-NOTIFICATION-ID   TO SXK-NOTIFY-REQUEST-ID.
   MOVE 'SXK9999I'                TO SXK-NOTIFY-MSG-ID.
   MOVE ' A Notify Message'       TO SXK-NOTIFY-DATA.
   MOVE ' SXKCNUEV'               TO SXK-NOTIFY-SOURCE.
   MOVE 'Function Name'           TO SXK-NOTIFY-SUBSOURCE.
   MOVE 'BATCH'                   TO SXK-NOTIFY-PLATFORM.
* Set total length of the record
   MOVE LENGTH OF SXK-NOTIFICATION-REQUEST  TO SXK-NOTIFY-SEG-LEN.
   SET ERROR-MSG-POINTER                    TO NULL.
 
* Call Tracker interface routine
   CALL 'SXKADSSI'
     USING BY REFERENCE  WS-SSID,
           BY REFERENCE  SXK-NOTIFICATION-REQUEST,
           BY VALUE      SXK-FUNCTION-ID,
           RETURNING     ERROR-MSG-POINTER
   END-CALL.
 
* See if there is an error message returned
   IF ERROR-MSG-POINTER NOT = NULL
     PERFORM 850-ON-CALL-ERROR
   END-IF.

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved