Previous Topic: User Exit Routines

Next Topic: Exit #1


Account Exit

The account exit, if activated, passes each account record just as it is about to be written to the account file. This exit may modify, delete, or insert records at this point. Note that extreme care must be exercised if records are being inserted since no further editing or validation operations are performed before the record is written to the account file.

The parameter list contains the following parameters:

Word

Description

1

Address of logical record currently being processed (following the Record Description Word (RDW)).

2

Address of a 1-character disposition indicator.

3

Address of a 1-character insertion indicator.

Each Account Record is made available to the user exit routine.

A value of EBCDIC blank (hex '40') in the disposition indicator on entry to the account exit indicates that a record is available to be processed. If the exit needs to modify or extract information from the record, it can do so at this time.

If the modifications include a change to the record length, the exit must move the record to its own work area, make the required modifications to the record in the work area, then store the address of the modified record back into the first word of the parameter list before returning control to the Report Writer.

If the exit needs to delete the record from further processing, it must set the disposition indicator to any nonblank value before returning control to the Report Writer. In order to insert records into the input stream, the exit must set the insertion indicator to any nonblank value, and store the address of the record to be inserted in the first word of the parameter list before returning control to the Report Writer. The record to be inserted must be preceded by a valid Record Descriptor Word (RDW) that contains the length of the record (including the four bytes for the RDW), but the address stored into the first word of the parameter list must point to the beginning of the record after the RDW.

When the user exit is next invoked, after the inserted record has been processed, it again receives a pointer to the original record, which it can now choose to process, or delete, or it can continue inserting records of its own.

High values (hex 'FF') in the disposition indicator on entry to the account exit indicates that end-of-file has been reached. No record is available for processing at this point, nor can any additional records be inserted. The account exit should take this opportunity to prepare totals, generate user-formatted reports, close its files, etc.