You are here: User Exits > Output User Exits

Output User Exits

An output exit is most commonly used to compress data, but any other programmable action could also be performed.

Note: Output exits are only supported for the Extract command.

Running an OUTPUT User Exit

The command string to create an output record against which an output user exit should be applied must include an exitname tag EXIT:

EXIT exitname

Where exitname is the name of the user supplied program that resides in a load library accessible to the application.

When an output user exit is used, the output data file is always created as Variable length, with a maximum record length equal to the record length of the input file. This can be changed using the SIZE keyword.

From the command line only, the user can enter:

EXTRACT <RECORD / fields> TO JUNK EXIT 'ASMSAMP'

The file "JUNK" will be created with the same record length as the input file.

Alternatively the user can enter:

EXTRACT <RECORD / fields> TO JUNK EXIT ASMSAMP SIZE n

SIZE enables the user to specify the output record length n for file "JUNK" to a maximum of 32756. If SIZE is omitted, file "JUNK" will be created with the logical record length of the input table (or the field length) plus an additional 4 bytes.

Note: The SIZE parameter is necessary when the output user exit will increase the size of an output record past the logical length of the extracted data.