Previous Topic: Extraction, Split User Exits, and Split File Time Processing

Next Topic: Specify the TODD Operand

Writing EXTRACT Exits

Through the EXIT operand of the EXTRACT command, you can identify user-written exit routines to:

Such routines are intended for the actual processing of SMF data, not for specifying additional selection parameters. (To add selection criteria, the exit routines themselves must contain the code to analyze and write the desired records.) You may define your exit routines so that they process records selected by more than one EXTRACT statement.

Exit routines must be linked as load modules, making them available for dynamic loading when the CA SMF Director (SMFD) program executes. SMFD loads the exit routines before processing any SMF records. They are resident until SMFD processing is completed.

The SMFD program calls each exit routine once before actually starting to process SMF records. This enables the routines to perform initialization functions, such as opening data sets.

During the processing, each exit routine is called once for each SMF record that satisfies the selection criteria specified in the EXTRACT statements calling for the exit.

After all SMF records have been processed, SMFD calls the exit routines a last time, permitting them to perform summary and cleanup operations.

EXTRACT exit routines are called according to normal OS linkage conventions. The following registers are meaningful on entry to the routines:

R1

Points to a four-word parameter list (described on the next page).

R13

Points to a standard 18-word OS Save Area, which exits may use to save registers.

R14

Contains the return address to SMFD.

R15

Contains the address of the exit's entry point.

Register 1 points to this four-word parameter list, where:

Word 1

Points to a halfword that contains a value of binary 1.

Word 2

Points to the header of the SMF record being passed to the exit. This fullword also signals the call to perform initialization or cleanup functions. If the length field (Word 3) indicates no SMF record (value of zero), this word contains the address of a halfword function code field. A binary value of zero in this field represents an initialization call; binary 1 represents a termination call.

Word 3

Points to a halfword field that specifies the SMF record length. A value of zero indicates a start or end call.

Word 4

Points to a fullword. Its value is zero on the first call, then remains as set by the exit routine. It is generally used to address an area acquired by the exit.

Upon your return to CA SMF Director, Register 15 must contain one of the following return codes:

0

Count the record, and write it if the TODD parameter was coded.

4

Count the record, but do not write it.

8

Neither count nor write the record.

A sample user exit is provided in the CASFSRC Library with the member name CASFXXIT.