Output record exit

Using the output record exit, you can modify or ignore the records ACIF writes into the output document file. The program invoked at this exit is defined by the OUTEXIT parameter.

The exit receives control before a record is written to the output document file. The exit can request that the record be ignored or processed. The largest record that the exit can process is 32752 bytes, not including the record descriptor word. The exit is not called when ACIF is processing resources.

The following example contains a sample C language header that describes the control block passed to the exit program.
typedef struct _OUTEXIT_PARMS /* Parameters for the output record exit       */
{
   char           *work;      /* Address of 16-byte static work area         */
   PFATTR         *pfattr;    /* Address of print file attribute information */
   char           *record;    /* Address of the record to be written         */
   unsigned short recordln;   /* Length of the output record                 */
   char           request;    /* Delete or process the record                */
   char           eof;        /* Last call indicator                         */
} OUTEXIT_PARMS;
The address of the control block containing the following parameters is passed to the output record exit:
work (Bytes 1–4)
A pointer to a static, 16-byte memory block. The exit program can use this parameter to save information across calls (for example, pointers to work areas). The 16-byte work area is aligned on a full word boundary and is initialized to binary zeros prior to the first call. The user-written exit program must provide the code required to manage this work area.
pfattr (Bytes 5–8)
A pointer to the print file attribute data structure.
record (Bytes 9–12)
A pointer to the first byte of the output record. The record resides in a 32 KB (where KB equals 1024 bytes) buffer. The buffer resides in storage allocated by ACIF, but the exit program is allowed to modify the output record.
recordln (Bytes 13–14)
Specifies the length, in bytes, of the output record. If the output record is modified, this parameter must also be updated to reflect the actual length of the record.
request (Byte 15)
Specifies how the record is to be processed by ACIF. On entry to the exit program, this parameter is X'00'. When the exit program returns control to ACIF, this parameter must have the value X'00' or X'01', where:
X'00'
Specifies that the record be processed by ACIF.
X'01'
Specifies that the record be ignored by ACIF.

A value of X'00' on entry to the exit program specifies that the record be processed. If you want to ignore the record, change the request byte value to X'01'. Any value greater than X'01' is interpreted as X'00'; the exit processes the record.

Only one record can reside in the buffer at any time.

eof (Byte 16)
An End-Of-File (eof) indicator. This indicator is a one-byte character code that signals when ACIF has finished writing the output file.
When eof is signaled (eof value=‘Y’), the last record has already been presented to the output exit. The record pointer is no longer valid. The only valid values for this parameter:
Y
Specifies that the last record has been written.
N
Specifies that the last record has not been written.

This end-of-file flag, used as a last-call indicator, allows the exit program to return control to ACIF. The exit program cannot change this parameter.

The following example contains a sample DSECT that describes the control block passed to the z/OS® exit program.
PARMLIST DSECT          Parameters for the output record exit
WORK@    DS    A        Address of 16-byte static work area
PFATTR@  DS    A        Address of print-file-attribute information
RECORD@  DS    A        Address of the record to be written
RECORDLN DS    H        Length of the output record
REQUEST  DS    X        Delete or process the record
EOF      DS    C        Last call indicator  
The address of the control block containing the following parameters is passed to the output record exit. For z/OS , the address is passed in a standard parameter list that is pointed to by Register 1.
WORK@ (Bytes 1–4)
A pointer to a static, 16-byte memory block. The exit program can use this parameter to save information across calls (for example, pointers to work areas). The 16-byte work area is aligned on a full word boundary and is initialized to binary zeros prior to the first call. The user-written exit program must provide the code required to manage this work area.
PFATTR@ (Bytes 5–8)
A pointer to the print file attribute data structure.
RECORD@ (Bytes 9–12)
A pointer to the first byte of the output record. The record resides in a 32KB (where KB equals 1024 bytes) buffer. The buffer resides in storage allocated by ACIF, but the exit program is allowed to modify the output record.
RECORDLN (Bytes 13–14)
Specifies the length, in bytes, of the output record. If the output record is modified, this parameter must also be updated to reflect the actual length of the record.
REQUEST (Byte 15)
Specifies how the record is to be processed by ACIF. On entry to the exit program, this parameter is X'00'. When the exit program returns control to ACIF, this parameter must have the value X'00' or X'01', where:
X'00'
Specifies that the record be processed by ACIF.
X'01'
Specifies that the record be ignored by ACIF.

A value of X'00' on entry to the exit program specifies that the record is to be processed. If you want to ignore the record, change the REQUEST byte value to X'01'. Any value greater than X'00' is interpreted as X'00'; the exit processes the record.

Only one record can reside in the buffer at any time.

EOF (Byte 16)
An end-of-file (EOF) indicator. This indicator is a one-byte character code that signals when ACIF has finished writing the output file.
When EOF is signaled (EOF=Y), the last record has already been presented to the output exit. The pointer RECORD@ is no longer valid. Records cannot be inserted when EOF is signaled. The only valid values for this parameter:
Y
Specifies that the last record has been written.
N
Specifies that the last record has not been written.

This end-of-file flag, used as a last-call indicator, allows the exit program to return control to ACIF. The exit program cannot change this parameter.

Important: If the output and index file from ACIF are stored in Content Manager OnDemand, do not delete output records using Output record exit as this might invalidate the indexing information.