         TITLE     'SRU CP EXIT for Separator Page Printing'            SRU00010
*  Author:    Francis J Hensler, CDP                                    SRU00020
*             Slippery Rock University                                  SRU00030
*  E-mail     fjh@sruvm.sru.edu                                         SRU00040
*  Date:      08 APR 1997                                               SRU00050
*  Reference: CP Exit Customization SC24-5672                           SRU00060
*  Tested:    VM/ESA 2.1                                                SRU00070
*  Disclaimer:CP Exits can cause system abends or abnormal              SRU00080
*                operation -- use at your own risk.                     SRU00090
*                                                                       SRU00100
*  To Compile:                                                          SRU00110
*       GLOBAL MACLIB HCPOM1 HCPOM2 HCPPSI HCPGPI                       SRU00120
*       HASM SRUSEP                                                     SRU00130
*                                                                       SRU00140
*  CP Calls this exit for exit numbers 4401 4402 4404 & 4407            SRU00150
*  Copy SRUSEP TEXT to the CP Parm disk (MAINT CF1).                    SRU00160
*  CP commands to enable the exits are:                                 SRU00170
*       CP CPXLOAD SRUSEP TEXT NOCONTROL TEMPORARY                      SRU00180
*       CP ASSOCIATE EXIT 4401 ENABLE EPNAME SRUSEP00                   SRU00190
*       CP ASSOCIATE EXIT 4402 ENABLE EPNAME SRUSEP00                   SRU00200
*       CP ASSOCIATE EXIT 4404 ENABLE EPNAME SRUSEP00                   SRU00210
*       CP ASSOCIATE EXIT 4407 ENABLE EPNAME SRUSEP00                   SRU00220
*                                                                       SRU00230
*  If there are problems then the exits can be disabled by:             SRU00240
*       CP DISABLE EXITS ALL                                            SRU00250
*                                                                       SRU00260
*                                                                       SRU00270
*  If the printer address is 06F then the exit is ignored.              SRU00280
*  All other addresses are assumed to be laser printers so              SRU00290
*  we want to print only one separator page.                            SRU00300
*                                                                       SRU00310
*                                                                       SRU00320
         MACRO                                                          SRU00330
&LABEL   SRUMDLAT  &EPNAME                                              SRU00340
         MDLATHDR  &EPNAME                                              SRU00350
         MDLATENT  HCPMM2,MODATTR=(PAG,MP,DYN)                          SRU00360
         MDLATENT  SRUSEP,MODATTR=(PAG,MP,DYN),CPXLOAD=YES              SRU00370
         MDLATTLR                                                       SRU00380
         MEND                                                           SRU00390
         HCPCMPID COMPID=SRU                                            SRU00400
         COPY     HCPOPTNS                                              SRU00410
SRUSEP   HCPPROLG ATTR=(PAGEABLE,REENTERABLE,INDIRECTCALL),BASE=(R12), -SRU00420
               COPYR=(1997),COPYRID='SLIPPERY ROCK UNIVERSITY'          SRU00430
         COPY     HCPEQUAT             GENERAL EQUATES                  SRU00440
         COPY     HCPEQXIT             EQUATES FOR EXIT CONTROL         SRU00450
         COPY     HCPCWOEQ             CCW EQUATES                      SRU00460
         COPY     HCPPFXPG             HOST PREFIX PAGE                 SRU00470
         COPY     HCPPLXIT             PLIST DEFS FOR IBM EXIT POINTS   SRU00480
         COPY     HCPSAVBK             SAVEAREA BLOCK                   SRU00490
         COPY     HCPVMDBK             VM DEFINITION BLOCK              SRU00500
         COPY     HCPRDEV              REAL DEVICE BLOCK                SRU00510
         COPY     HCPSEPBK             TRAILER SEPARATOR PAGE           SRU00520
         PRINT    ON,GEN                                                SRU00530
SRUSEP00 HCPENTER CALL,SAVE=DYNAMIC                                     SRU00540
         HCPUSING PFXPG,R0                                              SRU00550
         HCPUSING X4400,R1             EXIT PARAMETER LIST              SRU00560
         HCPUSING RDEV,R3              REAL DEV BLOCK                   SRU00570
         HCPUSING VMDBK,R11                                             SRU00580
         HCPUSING SAVBK,R13                                             SRU00590
*                                                                       SRU00600
*                                      R0 contains CP Exit Number       SRU00610
         CH       R0,=X'4407'          Test for exit 4407               SRU00620
         BE       EXIT4407                                              SRU00630
*                                                                       SRU00640
         L        R3,X4400RDV          =A(RDEV)                         SRU00650
*                                                                       SRU00660
         CLC      RDEVDEV,=X'006F'     IS IT THE 4245 LINE PRINTER      SRU00670
         BE       RETURN0               YES, NO FURTHER PROCESSING      SRU00680
*                                                                       SRU00690
* Exit 4401: Separator Page Pre-Perforation Positioning                 SRU00700
         LA       R15,4                RC=4: Ignore I/O                 SRU00710
         CH       R0,=X'4401'                                           SRU00720
         BE       RETURN                                                SRU00730
*                                                                       SRU00740
* Exit 4402: Separator Page Perforation Printing                        SRU00750
         CH       R0,=X'4402'                                           SRU00760
         BNE      NOT4402                                               SRU00770
         L        R4,X4400PG1          A(SEPPAG1) CCW                   SRU00780
         MVC      0(16,R4),SKIP1       Skip to channel 1                SRU00790
         LA       R15,0                RC=0: Continue                   SRU00800
         B        RETURN                                                SRU00810
NOT4402  EQU      *                                                     SRU00820
*                                                                       SRU00830
* Exit 4404: Second Separator Page Positioning                          SRU00840
         LA       R15,8                RC=8: Ignore I/O & Terminate     SRU00850
         CH       R0,=X'4404'                                           SRU00860
         BE       RETURN                                                SRU00870
* Exit 4404 terminates separator page printing for the current file.    SRU00880
         HCPDROP  R1                                                    SRU00890
*                                                                       SRU00900
EXIT4407 EQU      *                                                     SRU00910
* Exit 4407 Trailer Page Processing                                     SRU00920
* For Laser printers we just do a skip to channel 1                     SRU00930
         HCPUSING X4407,R1             EXIT PARAMETER LIST              SRU00940
         L        R3,X4407RDV          =A(RDEV)                         SRU00950
         CLC      RDEVDEV,=X'006F'     IS IT THE 4245 LINE PRINTER      SRU00960
         BE       RETURN0                                               SRU00970
         L        R4,X4407PG1          A(SEPPAG1) CCW                   SRU00980
         MVC      0(16,R4),SKIP1       Skip to channel 1                SRU00990
*        B        RETURN0                                               SRU01000
*                                                                       SRU01010
RETURN0  LA       R15,0                RC=0 for all other entries       SRU01020
RETURN   ST       R15,SAVER15          STORE THE RETURN CODE            SRU01030
         HCPEXIT  EP=(SRUSEP00),SETCC=NO                                SRU01040
*                                                                       SRU01050
*        This CCW copied from HCPSEP ASSEMBLE                           SRU01060
SKIP1    CCW1     CWOPSC1I,0,CCWCC+CCWSILI,1     SKIP to Ch 1           SRU01070
SENSE    CCW1     CWOSENSE,0,CCWSILI+CCWSKIP,1   SENSE                  SRU01080
         LTORG                                                          SRU01090
         HCPDROP  R0                                                    SRU01100
         HCPDROP  R1                                                    SRU01110
         HCPDROP  R3                                                    SRU01120
         HCPDROP  R11                                                   SRU01130
         HCPDROP  R13                                                   SRU01140
         HCPEPILG                                                       SRU01150
