Version 8.1.4
 —  Utilities  —

The ADACDC User Exit

ADACDC calls a user exit at various points in its processing, providing you with the opportunity to intercede in that processing.

This document covers the following topics:


Installing the Exit

Start of instruction setTo install the user exit

  1. Compile the user exit you wish ADACDC to use as module name ADACDCUX.

  2. Make the module available to the ADACDC utility.

A sample user exit called ADACDCUX is provided on the source data set. The only function of the sample is to show you how to add, delete, and update records using the user exit interface.

Top of page

User Exit Interface

The user exit is called with the following registers set:

R1 user parameter list
R13 standard 72-byte register save area
R14 return address
R15 entry point

The user parameter list contains two pointers:

The action to be performed is indicated in the CDCUFUNC field whereas the action the user exit directs ADACDC to take on return is indicated using the CDCURESP field.

graphics/cdc2_standard0.png

ADACDC User Exit

The structure of the ADACDC user exit interface control block (CDCU DSECT) is as follows:

Bytes Description
0-3 constant 'CDCU'
4-7 available for use by user exit
8-11 length of record in second parameter
12
function identifier:  
X'00' initialization
X'04' before pass to SORT input
X'08' before write to extract file
X'0C' before write to primary output file
X'10' termination
13
response code from user exit:
X'00' normal processing
X'04' ignore this record
X'08' record has been updated
X'0C' insert new record
14-31 reserved for future use

Top of page

User Exit Calls

The following subsections describe the calls made to the user exit and their purpose.

Initialization Call (CDCUFUNC=CDCUINIT)

During initialization, ADACDC calls the user exit so that it can set up any areas it requires for future processing. The CDCUUSER field is provided in the CDCU for anchoring a user control block, if appropriate.

The record area pointer points to data that has no relevance for this call.

Termination Call (CDCUFUNC=CDCUTERM)

During termination, ADACDC calls the user exit so that it can close any open files or clean up any areas still outstanding after ADACDC execution. For example, if an anchor pointer was set in CDCUUSER, this area could be freed and the CDCUUSER field set to nulls.

The record area pointer points to data that has no relevance for this call.

SORT Input Call (CDCUFUNC=CDCUINPT)

ADACDC calls the user exit before a record is passed to the SORT routine as input.

The record area pointer points to the compressed data record to be returned prefixed by the CDCE control block.

The exit may elect to

Extract Output Call (CDCUFUNC=CDCUWRTE)

ADACDC calls the user exit before a record is written to the extract file during phase 1 processing. This exit point is only called during phase 1 processing and has no relevance in other cases.

The record area pointer points to compressed the data record to be written prefixed by the CDCE control block.

The exit may elect to

Primary Output Call (CDCUFUNC=CDCUWRTO)

ADACDC calls the user exit before a record is written to the primary output file. This exit point is not called during phase 1 processing and has no relevance in this case.

The record area pointer points to the decompressed data record to be written prefixed by the CDCO control block.

The exit may elect to

Updating or Adding Records

Consider the following points when updating or adding records from the exit:

Top of page