This SPOOL exit allows systems support to create a user routine which is invoked with every SPOOL output operation. Only during error handling is it not called. The exit routine is called after a channel program has been generated and before this channel program is sent to the printer. The exit routine can be used with line printers and laser printers. APA printers, RSO, remote batch processing, magnetic tapes and floppy disks are not supported.
The exit routine allows you to
accept the channel program
modify the channel program
suppress the channel program
The exit routine is provided with the following information: R1 = A (EX095 parameter area)
The return codes are entered in the standard header:
dd | cc | bb | aa |
A return code concerning execution of EX095 is passed in the standard header:
aa=maincode1
bb=maincode2
cc=subcode1
dd=subcode2
X'aa' | Meaning |
00 | Channel program output |
04 | Channel program not output |
0C | Channel program not output |
Notes
The exit routine can access the SPOOL data structures. These data structures are version-specific.
If the channel program is modified or is not output, the SPOOL accounting record is not modified.
No code translation is performed on the data passed by the exit routine.
If the channel program is modified, attention should be paid to the following rules:
The channel program and the data buffer must not be extended.
If the data addressed by a channel command is shortened, the data length information of the channel command must be corrected accordingly.
If the channel program is shortened, the “end-of-chain indicator” must be corrected accordingly.
The data address can be modified but it must be an address in the SPOOL output range.
The “start of output range” address is contained in the first channel command in the chain. The “end of output range” is computed by adding the data length to the data address of the last channel command.
DSECT
A DSECT/CSECT for the parameter area can be generated by means of the EX095 macro. ”prefix” must not be longer than 3 characters.
EX095 D RECEXPL DSECT , I/O EXIT ROUTINE P/L * * STANDARD HEADER RETURN INFORMATION * SPOEXBEG DS 0H FHDR MF=(C,SPO),EQUATES=NO DS 0A SPOFHE DS 0XL8 0 GENERAL PARAMETER AREA HEADER * SPOIFID DS 0A 0 INTERFACE IDENTIFIER SPOFCTU 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 SPOFCT DS AL1 2 FUNCTION NUMBER SPOFCTV DS AL1 3 FUNCTION INTERFACE VERSION NUMBER * SPORET DS 0A 4 GENERAL RETURN CODE SPOSRET DS 0AL2 4 SUB RETURN CODE SPOSR2 DS AL1 4 SUB RETURN CODE 2 SPOSR1 DS AL1 5 SUB RETURN CODE 1 SPOMRET DS 0AL2 6 MAIN RETURN CODE SPOMR2 DS AL1 6 MAIN RETURN CODE 2 SPOMR1 DS AL1 7 MAIN RETURN CODE 1 SPOFHL EQU 8 8 GENERAL OPERAND LIST HEADER LENGTH * * * EQUATES FOR EXIT RETURN INFORMATION IN &P.MR1 * SPOEXIO EQU 0 SEND I/O REQUESTED SPOEXNI EQU 4 DO NOT SEND I/O SPOEXEO EQU 12 NO I/O DECLARE EOF SPOPRTYP DC AL1(0) PRINTER TYPE SPOLINES EQU 32 LINES PRINTER TYPE 751 SPOPAGES EQU 33 PAGE PRINTER TYPE 751 SPOLOADL EQU 34 LOADABLE LINE PRINTER TYPE 751 SPOINFOR DC X'00' INFORMATION GIVEN TO EXIT SPONOSCB EQU X'01' IND. SPOSCBAD NOT FILLED SPOUNUS DC XL2'00' **** UNUSED **** SPOCHADD DC A(0) CCW'S CHAIN OR BUFFER ADDRESS SPOSCBAD DC A(0) ADDRESS OF SCB SPODVTYP DS AL1 DEVICE TYPE SPOPRTMN DS CL2 PRINTER MNEMONIC DS CL20 RESERVED FOR EXTENTION SPOPLLEN EQU *-SPOEXBEG LENGTH OF THE PARAMETER LIST
The SPOCHADD field contains the address of the channel program. The format of a channel command is not dependent on the channel or device type.
op | fl | count | address |
op = operation code
fl = flag byte
count = data length
address = virtual data address
Notes
The operation codes of the channel command are dependent on the channel type and printer type and are not checked by SPOOL on reentry from the exit routine.
The SPONOSCB field indicates that the SPOSCBAD field does not contain an SCB address and cannot therefore be used. This can occur if SPOOL carries out I/O operations which are not assigned to jobs.
The SPODVTYP field contains the same detailed device type as used in the SPOOL parameter file. The SPSDTYP macro must be used to resolve it.
The SPOPRTMN field contains the mnemonic device name of the printer.