EMS Manual
EMS Manual—426909-005
B-1
B Example of Reporting Events
This appendix presents a working example of a subsystem like one you might write.
The programs in this example generate event messages when subsystem-defined
events occur. This example outlines the programming structure that your subsystems
will require to report events. The example demonstrates how to use EMS procedures
to build event messages and how to send those messages to the collector ($0) through
use of the OPEN, CLOSE, and WRITEREAD procedures.
There are five files in this example:
The MAKE TACL macro file to compile the user subsystem DDL and the TAL
program.
CXOURDDL is a DDL compile control file.
XOURDDL is a DDL source file.
SOURTMPL is a source template file.
CSRC is a C source file.
TACLSRC is a TACL source file.
The DDL file contains statements to support event-message creation. The file defines
a token with an enumerated type and an extensible structured token.
Testing the Program
1. Run the MAKE TACL macro. This compiles and links the C program and compiles
the EMS template file, SOURTMPL.
2. Create an edit file, called INFILE, with two lines. The first line specifies the location
of the current EMS template file that's installed on the system. The second line
specifies, XOURTMPL, which is the template object file created from SOURTMPL.
file $system.sys01.template
file xourtmpl
3. Run TEMPLI to generate a EMS template file you can use for testing.
RUN TEMPLI /IN INFILE/ TEMPR, TEMPNR
Topic Page
Testing the Program
B-1
The MAKE TACL Macro File B-3
The DDL Compile-Control File B-3
The SOURTMPL File B-5
The C Source File B-6
The TACL Source File B-10