EMS FastStart Manual
COBOL85 Program Example
EMS FastStart Manual–133701
C-6
?HEADING "300-INITIALIZE-EGEN-RECORD SECTION"
/
 300-initialize-egen-record.
*----------------------------------------------------------------------
* This section will initialize the egen-record by calling the
* Initialize^egen^record procedure. This procedure is included in the
* Egen object file and sourced with the ?SEARCH compiler directive.
*
* Initialize^egen^record will move spaces to character fields and
* high values to all fields in egen-record. The following is a list
* of high values used to initialize non-character fields.
*
* LITERAL EMSFS^DEFAULT^INT = 32767;
* LITERAL EMSFS^DEFAULT^INT2 = 2147483647D;
* LITERAL EMSFS^DEFAULT^INT4 = 92233720368545775807F;
* LITERAL EMSFS^DEFAULT^TRANSID = 9223372036854775807;
* LITERAL EMSFS^DEFAULT^TIMESTAMP = 9223372036854775807;
* LITERAL EMSFS^DEFAULT^UINT = %177777;
* LITERAL EMSFS^DEFAULT^ENUM = 32767;
*
* After the egen-record is initialized, we will move the application
* ssid to the specific fields in this record.
*----------------------------------------------------------------------
 ENTER TAL "Initialize^egen^record" USING egen-record GIVING return-code.
 IF return-code IS NOT EQUAL TO ZERO
 PERFORM 400-validate-return-code.
 MOVE ZERO TO return-code.
 MOVE ATM-VAL-OWNER TO ssid-owner OF egen-record.
 MOVE ATM-SSN-NUMBER TO ssid-subsystem-number OF egen-record.
 MOVE ATM-VAL-VERSION TO ssid-version OF egen-record.
?HEADING "365-CLOSE-COLLECTOR SECTION"
/
 365-close-collector.
 ENTER TAL "Close^egen^collector" USING file-number
 GIVING return-code.
 IF return-code NOT = ZERO
 PERFORM 400-validate-return-code.
?HEADING "400-VALIDATE-RETURN-CODE SECTION"
/
 400-validate-return-code.
 IF return-code = EGEN-GENERATE-EVENT-OK
 DISPLAY "Egen generated the event message successfully"
 ELSE
 IF return-code = EGEN-INITIALIZE-MISSING-PARAM
 DISPLAY "Egen Error: ** Egen-initialize-missing-param, error #1 **"
 DISPLAY "Error Detail: " WITH NO ADVANCING
 DISPLAY egen-error OF egen-record
 ELSE
 IF return-code = EGEN-OPEN-MISSING-PARAM
 DISPLAY "Egen Error: ** Egen-open-missing-param, error #10 **"
 DISPLAY "Error Detail: " WITH NO ADVANCING
 DISPLAY egen-error OF egen-record
 ELSE
 IF return-code = EGEN-OPEN-INVALID-SYNC-DEPTH
 DISPLAY "Egen Error: ** Egen-open-invalid-sync-depth, error #11 **"










