EMS FastStart Manual

Building Your Application for Event Generation
EMS FastStart Manual133701
6-19
Pass the Record Structure to EGEN
Pass the Record Structure to EGEN
Pass the record structure to EGEN by issuing the following statement from within the
user application:
ENTER TAL "Egen" USING egen-record GIVING return-code.
Error Handling and Return Codes
Each time you call one of the procedures implemented in the EGEN module you should
check to see if any errors occurred when generating an event by verifying the value of
the return-code. Appendix B, EGEN Messages
, describes the return codes defined
between EGEN and a user application (implemented by EGEN as a set of TAL
procedures).
A return-code for each procedure implemented in the EGEN module informs the calling
application of the status of the operation requested. If the return-code is equal to
zero (0), the operation was successful. If the return-code is not equal to zero (0), it
indicates a warning or an error. Also, a special field called egen-error (Integer) in the
EGEN record structure is used to give you more detailed information about the error.
The contents of this field depend on the return-code of the EGEN procedures.
Example 6-15. ATM COBOL85 Example
?HEADING "240-ATM-DOWN SECTION"
/
240-atm-down.
*-----------------------------------------------------------------------
* EVENT # 200: ATM IS DOWN:
*
* the fields within the EGEN record which are used for event # 200:
*
* event-type PIC S9(4).
* event-number NATIVE-2.
* atm-name PIC X(8).
* atm-location PIC X(24).
* event-text PIC X(254).
*
*-----------------------------------------------------------------------
PERFORM 300-initialize-egen-record.
MOVE CRITICAL-EVENT TO event-type OF egen-record.
MOVE ATM-EVT-DOWN TO event-number OF egen-record.
MOVE "LACENT99" TO atm-name OF egen-record.
MOVE "atm-name" TO subject-field-name OF egen-record.
MOVE "9320 Main St., Los Angeles" TO atm-location OF egen-record.
ENTER TAL "Egen" USING egen-record, file-number
GIVING return-code.
IF return-code NOT = ZERO
PERFORM 400-validate-return-code.