EMS Manual
Example of Retrieving Event Messages
EMS Manual—426909-005
A-24
C Source File
DISPLAY evt-text-line (ind) (1: actual-len
(ind))
END-PERFORM
* Move context token from the reply
* into the copy of the orig. command
ENTER "SSMOVE"
USING zspi-tkn-context, distr-rec, 1, save-buf, 1
GIVING error-flag
EVALUATE error-flag
WHEN zspi-err-mistkn
* Done if no context token
SET end-of-loop TO TRUE
WHEN 0
* Move the updated command to distr-rec
* for next time through the loop
MOVE save-buf TO distr-rec
WHEN OTHER
ENTER "DEBUG"
END-EVALUATE
END-PERFORM
.
C Source File
This file contains the main C source:
/* File name: MYAPMAIN -------------------------------------
*
* The MYAP application does the following:
*
* - Starts and opens a consumer distributor
*
* - Prompts you at your terminal for a CPU number
*
* - Issues CONTROL command messages to
*
* connect the collector $0
* load a filter file
* load a filter param
* (cpu-number from user)
*
* - Performs the following steps in a loop:
* -- Issues a GETEVENT command message
* -- Displays an event message at your terminal
*
* MYAP waits for new events from the given CPU and displays
* them as they arrive.
*
* To terminate the program, press the BREAK key
* and type STOP.
*
* The filter file must be $SYSTEM.FILT.MYAPFOBJ.
*/