EMS Manual

Example of Retrieving Event Messages
EMS Manual426909-005
A-19
COBOL Source File
COBOL Source File
This file contains the main COBOL 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 SPI 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 an SPI 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.
*
?SEARCH $system.system.cobollib
?CONSULT $system.system.cobolex0
?SAVE STARTUP
IDENTIFICATION DIVISION.
PROGRAM-ID. dist-initfc.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. Tandem.
OBJECT-COMPUTER. Tandem.
SPECIAL-NAMES.
FILE "$system.system.cbl85utl" IS cobutl.
* constants
REPLACE
==evt-text-len== BY ==78==
==num-evt-lines== BY ==2==
.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT distr-process ASSIGN TO #DYNAMIC.
DATA DIVISION.
FILE SECTION.
FD distr-process