BSLJX28B TITLE 'JES2 JOB Termination Exit (EXIT # 28)'                          
***********************************************************************         
*                                                                     *         
* This exit is invoked at job termination. It sets a flag in the JCT  *         
* (Bit1 in JCTUSER0+1).                                               *         
*                                                                     *         
* Register usage (Entry/Exit) :                                       *         
*                                                                     *         
*    Reg       Value on entry                                         *         
*                                                                     *         
*    R0        0                                                      *         
*    R1        Address of parameter list                              *         
*    R2-R10    n/a                                                    *         
*    R11       Address of HCCT                                        *         
*    R12       n/a                                                    *         
*    R13       Address of available save area                         *         
*    R14       Return address                                         *         
*    R15       Entry address                                          *         
*                                                                     *         
*    Reg       Value on exit                                          *         
*                                                                     *         
*    R0-R14    Unchanged                                              *         
*    R15       Return code (0)                                        *         
*                                                                     *         
* PARAMETER LIST :                                                    *         
*                                                                     *         
*        (+0)   Type of processing indicator                          *         
*                0 - Caller ID job termination (JOB/STC/TSU/XBM is    *         
*                    Terminating)                                     *         
*                4 - Caller is return ID (SYSLOG is terminating)      *         
*                8 - Caller is HASPAM (JOBLET is terminating)         *         
*               12 - Caller is JOB select (JOB/STC/TSU unable to      *         
*                    obtain resource                                  *         
*               20 - Caller is HASPAM (JOBLET is unable to restart    *         
*                    JOB because resources cannot be obtained).       *         
*        (+1)   Reserved                                              *         
*        (+2)   Response byte (Composed of bits 0-7).                 *         
*                Bits 0-6 - Reserved for future use                   *         
*                Bit  7   - If 1, Suppress JES2 JOB termination msg.  *         
*                           If 0, Issue JES2 JOB termination msg.     *         
*        (+3)   Reserved                                              *         
*        (+4)   Address of SJB                                        *         
*        (+8)   Address of JCT or Zero                                *         
*                                                                     *         
* Return codes (R15 on exit) :                                        *         
*                                                                     *         
*         0 - Normal JES2 processing resumes                          *         
*         4 - Same as 0 Execpt no further exits are to be called      *         
*                                                                     *         
***********************************************************************         
         COPY  $HASPGBL            Include the JES2 Global values               
BSLJX28B $MODULE SYSP=(GEN,GEN,DATA,GEN,GEN),                          *        
               TITLE='JES2 JOB Termination exit (EXIT # 28)',          *        
               ENVIRON=USER,                                           *        
               $HASPEQU,           HASP equates                        *        
               $BUFFER,            HASP Spool buffer DSECT             *        
               $CADDR,             Commom storage address table        *        
               $HFAME,             JES2 HFAME DSECT                    *        
               $HCCT,              Common storage communication table  *        
               $JCT,               Job Control Table                   *        
               $MIT,               Module information table            *        
               $PADDR,             REQUIRED                            *        
               $PARMLST,           JES2 PARMLST DSECT                  *        
               $PSV,               Process save area DSECT             *        
               $SCAT,              JES2 SCAT DSECT                     *        
               $USERCBS,           User defined control blocks         *        
               $XECB,              JES2 XECB DSECT                     *        
               RPL,                MVS RPL DSECT                       *        
               RMode=ANY           Load program above the line                  
         TITLE 'JES2 JOB TERMINATION EXIT (EXIT # 28)'                          
EXIT28C  $ENTRY BASE=R12                                                        
         $SAVE                                                                  
         LR    R12,R15             Load base register (R12)                     
         IF    (CLI,0(R1),0,EQUAL) Was it a Job termination?                    
         L     R7,8(,R1)           Yes - Load JCT address ...                   
         USING JCT,R7              ... and establish addressability             
         OI    JCTUSER0+1,BIT1     Set bit 1 on                                 
         ENDIF                                                                  
         $RETURN                   Return to caller                             
         IEZBITS                                                                
         LTORG                                                                  
        $MODEND                                                                 
         END                                                                    

