Exit Routines - Code-1_Plus - 5.0

CODE-1 Plus Guide for IBM i

Product type
Software
Portfolio
Verify
Product family
Data Quality - Postals
Product
CODE-1 Plus
Version
5.0
Language
English
Product name
CODE-1 Plus
Title
CODE-1 Plus Guide for IBM i
Copyright
2024
First publish date
1998
ft:lastEdition
2024-05-15
ft:lastPublication
2024-05-15T00:03:43.588945

The Submit Batch Job component allows you to specify the:

  • Input exit routine that CODE-1 Plus should call each time it is ready to read a record from your input name-and-address file.

and

  • Output exit routines that CODE-1 Plus should call each time it is ready to write a record to one of your output files.

If you are using an input exit routine, instead of reading the record, CODE-1 Plus calls your exit routine and waits for the exit routine to pass a record back. If you are using an output exit routine, instead of writing the record to the file, CODE-1 Plus passes the record to the output exit routine.

For example, you might have an input exit routine named CODEIT that adds a special code to a record. If you want to add that code to each record before the record is passed to CODE-1 Plus, you specify CODEIT as the name of the exit routine. Then, every time CODE-1 Plus is ready to accept a record, it passes control to CODEIT, which reads the record, adds the code to the record, and then passes the record to CODE-1 Plus so that CODE-1 Plus may process that record.

When you indicate that CODE-1 Plus should call an exit routine, it will call that exit routine with the following four parameters in the linkage section at each I/O request:

  • PARM1: This parameter is a total of 9 bytes, and has two components, as follows:

  • Bytes 1-8: The file name (C1BMNAM, C1BMCOK, C1BMNCO, C1BMIZP, or C1BMZP4).

  • Byte 9: Function indicator. This byte will contain one of the following codes to tell your program what type of processing to perform:

  •  O — Open the input or output file.

  •  R — Read a record from the input file.

  •  W — Write a record to the output file.

  •  C — Close the input or output file.

  • PARM2: This parameter is 4-digits long and packed into a 3-byte field (COBOL "PIC S9(5) COMP-3"). This parameter must be filled in by your exit routine if byte 9 of PARM1 is O or R. When byte 9 of PARM1 is R, the input exit routine signals the end of the file by setting this to 0.

  • PARM3: This parameter contains the output record to be passed from CODE-1 Plus to your program (when EXITFC is W), or the input record to be passed from your program to CODE-1 Plus (when EXITFC is R). The length of this parameter will be the length specified by the exit routine in PARM2 (maximum of 9999).

  • PARM4: This parameter contains the image of your FILEDF parameter record, and is 80 bytes in length.