OSI/TS Management Programming Manual

Sample Programs
056786 Tandem Computers Incorporated C–17
Event-Retrieval
Example
The remainder of this appendix presents an event-retrieval program that does the
following:
Starts and opens an EMS consumer distributor
Installs the filter whose object-file name you type in at your home terminal
Retrieves event messages that pass the filter
Displays these messages on the home terminal
The program is coded both in TAL and in C. The source code file for these examples
are provided as part of the OSI/TS software. They reside (by default) in
$SYSTEM.ZOSITS. EXEMST1 (TAL version) and $SYSTEM.ZOSITS.EXEMSC1 (C
version).
Example in TAL The following pages give the source code for the event-retrieval program in TAL.
! ***********************************************************
! * *
! * File: EXEMST1 *
! * *
! * This program demonstrates how to retrieve an event *
! * message produced by the OSI/TS subsystem and handle *
! * it appropriately. It does the following: *
! * *
! * - Starts and opens a consumer distributor *
! * *
! * - Prompts you at your terminal for the name of a *
! * filter object file. The filter name must be in *
! * GUARDIAN 90 local internal file name format: *
! * 8 bytes for the volume, 8 bytes for the subvolume, *
! * and 8 bytes for the individual file name. *
! * The volume and subvolume names must be padded on *
! * the right with spaces. For example: *
! * *
! * $myvol mysvol fltr1 *
! * *
! * - Issues SPI CONTROL commands to: *
! * Connect the collector $0 *
! * Load a filter file *
! * *
! * - Performs the following steps in a loop: *
! * Issues an SPI GETEVENT command *
! * Displays an event message at your terminal *
! * *
! * *
! * To terminate the program, press the BREAK key and *
! * type STOP. *
! * *
! ***********************************************************
?NOMAP,NOLMAP
?INSPECT,SYMBOLS
?EXTENDSTACK 4 ! To ensure enough stack space for EMSTEXT