This exit routine is called after a record from the output file has been read, but before the record is subjected to further processing by SPOOL in accordance with the entries in the PRINT-DOCUMENT command.
This exit may be used for output via line printer or laser printer (page printer). It cannot be used for output to magnetic tape or floppy disk.
The exit routine can initiate the following system functions:
accept the record that has been read in (updated or not updated)
replace the record that has been read in
skip the record that has been read in
skip the record that has been read in and all subsequent records up to the end of the file.
The following information is passed to the exit routine:
R1 = A(EX090 parameter area) R12 = A(TPR program manager) R13 = A(save area of calling component) R14 = A(indirect return) R15 = A(exit routine)
The return codes are entered in the standard header:
dd | cc | bb | aa |
A return code concerning execution of EX090 is passed in the standard header:
aa=maincode1
bb=maincode2
cc=subcode1
dd=subcode2
X'aa' | Meaning |
00 | Accept the record that has been read in |
04 | Replace the record that has been read in with the contents of the output block |
08 | Skip the record that has been read in |
0C | Skip the record that has been read in and all following records up to the end of the |
Notes
The exit routine should be neither activated nor deactivated while a spoolout is being processed.
The PRNTDOC macro may be utilized in the exit routine, but not $PRNT and $SPRQ.
Control is returned to the exit routine for every record read from the input file (including for the sample printout of the first page), until the operator initiates printing. The same applies to RESPOOL processing (HOLD-PRINT-JOB/RESUME-PRINT-JOB command), where the exit routine must also take account of the location of the start of RESPOOL.
The information required for processing files with control characters can be found in the PRINT-DOCUMENT command and the SPOOL control block.
If output blocks are provided, any memory class is permissible. However, it is advisable to choose class 5 memory. The memory is then released by the exit as soon as the exit has regained control.
DSECT
A DSECT/CSECT for the parameter area (the address is transferred in register 1) can be generated by means of the EX090 macro (“prefix” must not be longer than 3 characters):
name EX090 D/C ,[prefix]
After the return has taken place, the input fields are subject to no more checks on the part of the calling SPOOL component. The first and last exit routine calls take place without a record from the file being made available (ICLTYP = X’02’ or X’03’).
The byte IPRTYP specifies the output device.
Values for the output fields are supplied by the exit routine.
The byte IEXRC controls the function required by the exit routine. A more detailed analysis of the functions follows the DSECT.
EX090 D * SPOOL INPUT RECORDS ROUTINE EXIT PARAMETER LIST * IRC MFCHK MF=D,DMACID=E90,ALIGN=F,SUPPORT=(C,D),ENTRY=NO, C PREFIX=I,MACID=E90,DNAME=C IRC DSECT , *,##### PREFIX=I, MACID=E90 ##### * * STANDARD HEADER RETURN INFORMATION * IBEG DS 0H 00100510 FHDR MF=(C,I),EQUATES=NO 00100600 DS 0A IFHE DS 0XL8 0 GENERAL PARAMETER AREA HEADER * IIFID DS 0A 0 INTERFACE IDENTIFIER IFCTU DS AL2 0 FUNCTION UNIT NUMBER * BIT 15 HEADER FLAG BIT, * MUST BE RESET UNTIL FURTHER NOTICE * BIT 14-12 UNUSED, MUST BE RESET * BIT 11-0 REAL FUNCTION UNIT NUMBER IFCT DS AL1 2 FUNCTION NUMBER IFCTV DS AL1 3 FUNCTION INTERFACE VERSION NUMBER * IRET DS 0A 4 GENERAL RETURN CODE ISRET DS 0AL2 4 SUB RETURN CODE ISR2 DS AL1 4 SUB RETURN CODE 2 ISR1 DS AL1 5 SUB RETURN CODE 1 IMRET DS 0AL2 6 MAIN RETURN CODE IMR2 DS AL1 6 MAIN RETURN CODE 2 IMR1 DS AL1 7 MAIN RETURN CODE 1 IFHL EQU 8 8 GENERAL OPERAND LIST HEADER LENGTH * * EQUATES FOR EXIT RETURN INFORMATION * IACCPT EQU 0 ACCEPT RECORD AS IT IS IADD EQU 4 ADD RECORD(S) IDEL EQU 8 DELETE (SKIP) RECORD IEOF EQU 12 TERMINATE PRINT (SIMULATE EOF)
* INPUT FIELDS FOR THE INPUT EXIT ROUTINE * IREC@ DS A INPUT RECORD ADDRESS ISCB@ DS A SCB ADDRESS IRCLEN DS Y INPUT RECORD LENGTH IPRTYP DS AL1 TYPE OF PRINT ILINES EQU 32 LINES PRINTER TYPE 751 IPAGES EQU 33 PAGE PRINTER TYPE 751 ILOADL EQU 34 LOADABLE LINE PRINTER TYPE 751 IRBP EQU 35 RBP PRINTER TYPE 751 IRSOPB EQU 36 PUBLIC RSO PRINTER 752 IRSOPR EQU 37 PRIVATE RSO PRINTER 752 IAPAPR EQU 38 APA PRINTERS IPUNCH EQU 48 PUNCH TYPE 751 ICLTYP DS AL1 CALL TYPE ICLREC EQU 1 RECORD CALL TYPE ICLFST EQU 2 NO RECORD FIRST TIME CALL ICLLST EQU 3 NO RECORD LAST TIME CALL DS CL4 RESERVED FOR EXTENSION * * OUTPUT FIELDS FROM THE INPUT EXIT ROUTINE * IBLK@ DS A DATA BLOCK ADDRESS IBLKLE DS Y DATA BLOCK LENGTH IEXRC DS AL1 R-C FROM EXIT ROUTINE MAY BE * STORED HERE IN ADDITION TO * THE MAIN RETURN CODE IBEXRC DS AL1 BASE R-C FROM EXIT ROUTINE * IBRCOK EQU 0 BASE R-C O.K. INEXS EQU 4 EXIT ROUTINE NOT EXISTENT INACT EQU 8 EXIT ROUTINE NOT ACTIVE IPARER EQU 12 PARAMETER ERROR DS CL8 RESERVED FOR EXTENSION * * INPUT FIELDS FOR THE INPUT EXIT ROUTINE * IPIR DS A PRINTER INFORMATION RECORD ADDR. 755 IDVTYP DS AL1 DEVICE TYPE 755 DS CL11 RESERVED FOR EXTENTION 755 ILEN EQU *-IRC ROUTINE EXIT P/L LENGTH
Exit routine functions
Return code X’00’: accept the record that has been read
The address of the record and the record length are passed to the exit routine in the IREC@ or IRCLEN field. The record contains no record length field.
The exit routine can have SPOOL accept the record in unmodified form, or modify it itself.If its length is not increased at this stage, the record can be modified directly in the input buffer. In this case, the fields IBLK@ and IBLKLE must be supplied with the address of the record from IREC@ and the correct record length. If the modification increases the length of the record, then the exit routine must make the record available in a special buffer, addressed via IBLK@:
Return code X’04’: replace the record that has been read
SPOOL replaces the record which has been read in by those provided by the exit routine in the output block (address in IBLK@):
The exit routine must supply the contents for fields IBLK@ and IBLKLE.
If the record read is to be a component of the output block, the exit routine must transfer it to this block.
Return code X’08’: skip the record that has been read
The exit routine needs only to set the return code. No other action is necessary.
Return code X’0C’: skip all records up to the end of the file
The exit routine needs only to set the return code. No further action is necessary.
Operands in the PRINT-DOCUMENT command and PRNTDOC macro
The exit routine must take into consideration all operands specified in PRINT-DOCUMENT commands. The appropriate values can be derived from the SPOOL control block.
RECORD-PART=*PARAMETERS(FIRST-CHARACTER = n):
All records inserted by the exit routine must be longer than n bytes, otherwise they are not printed.
OUTPUT-PART=*RANGE(FROM = +n):
Records 1 to n are also transferred to the exit routine.
OUTPUT-PART=*LAST(LAST = -n):
Initially, the exit routine has control for all records from 1 to m (end-of-file, no output). SPOOL then sets the FROM value to z=(m-n+1) and processes the file as for FROM = +z.
ADDITIONAL-COPIES = n:
In the case of multiple output of a file, the exit routine cannot distinguish between the individual copies, i.e. there is no difference in the parameters or data records transferred.