The CA JARS File Utility provides two (2) exit points during record processing. Exits are assumed to be global; that is, if exits are specified, they are called for every input record read and for every output record written. Exit routines must be written in a language that supports standard OS linkage conventions. Exit routines must reside in a library that the File Utility has access to during processing. A BLDL is issued for each exit specified. If it fails, exit processing is bypassed. Exit routines are invoked according to the following standard linkage conventions:
|
Register |
Description |
|---|---|
|
13 |
Address of a register save area. |
|
14 |
Return address. |
|
15 |
Address of the exit routine's entry point. |
|
1 |
Address of the parameter list. |
The first exit point provides control to the user immediately after each input record is read into storage. At this point, you can perform further tests on the record to determine more selection and/or rejection criteria. Separate files can be created from the input data passed to the exit1 routine. Records can also be deleted from input processing.
The parameter list passed to the exit1 routine has the following format:
|
Word |
Description |
|---|---|
|
1 |
Fullword Address of the input record read. |
|
2 |
Fullword length of the record. |
|
3 |
Fullword end-of-file indicator. |
The exit1 routine is called for each record in every input file specified. To delete a record from further input processing, register 15, upon return, must contain a value of 4. To request that the exit1 routine not be called again, return register 15 with a value of 8. At end-of-file, the indicator passed to the exit1 routine contains a fullword 4; otherwise it is zero. No record is passed to the exit1 routine with this call. The return value in register 15 from the exit1 routine is also ignored with this call.
The second exit point provides you with control immediately before each record is written to the output file. If the OUTPUT command is not supplied, this exit point is bypassed. If you have coded COPY on any of your INPUT commands, then all records, whether selected or rejected, are written to the output file. It is at this point that you can write your own file of rejected records which can also be used in a future execution of the File Utility. Also, you can selectively let the File Utility create an output file of your choosing. Optionally, you can delete records from further output processing.
The parameter list passed to the exit2 routine is in the following format:
|
Word |
Description |
|---|---|
|
1 |
Fullword Address of the record. |
|
2 |
Fullword length of the record. |
|
3 |
Fullword Selection/Rejection indicator. |
|
4 |
Fullword final-call indicator. |
If a record passes all the criteria tests specified by the FIND command(s), then the Selection/Rejection indicator contains a value of zero (0); otherwise, it contains a value of four (4). If you did not code any FIND commands, then this indicator always contains a zero (0) value. In order to delete a record from output processing, the exit2 routine must return register 15 with a value of 4. To request that the exit2 routine not be called again, return register 15 with a value of 8. At the completion of all input file processing, the final-call indicator contains a value of 4; no record is passed to the exit2 routine with this call. The return value in register 15 from the exit2 routine is also ignored with this call.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |