TITLE 'DFSUTL - SAMPLE MVS IEFUTL TIMEOUT EXIT ' DFSUTL CSECT DFSUTL AMODE 31 DFSUTL RMODE ANY * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *** sample code... DFSUTL * * * IEFUTL is an MVS SMF exit routine for timeout. When added to * * your MVS system, it receives control when the job CPU time * * limit or the job step CPU time limit is exceeded and also * * when the continuous wait time limit for the job is exceeded. * * * * When a time limit is exceeded, it results in system cancellation * * of the job with S322 or S522 abends. * * * * This IMS/ESA specific IEFUTL exit is provided to protect * * IMS system availability. The lack of IMS installation * * enforcement of requiring TIME=1440 on the JOB or STEP JCL * * statements can lead to "untimely" abends of an IMS dependent * * region (IFP, MPP, BMP) while in the middle of a DL/I call. * * Such abends of IMS code result in abend U113 termination * * of IMS. * * * * Use this exit or use the code from here in your own IEFUTL * * exit in your installation. * * * * This exit will work with IMS 3.1 and later and it is IMS * * version and release independent. IMS 3.1 and 4.1 must have * * the LE/370 enablement APARs installed. They are: * * IMS 3.1 - APAR PN42272 * * IMS 4.1 - APAR PN36327 * * The LE/370 enablement APARs provide, for the first time in * * IMS, an architected way for the languages (COBOL, PL/I, etc) * * to determine if DL/I was in control when their ESTAE's are * * entered. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * REFER TO THE MVS BOOKS FOR A COMPLETE DESCRIPTION OF THE * * ENTRY AND EXIT REQUIREMENTS OF THIS ROUTINE. * * * * The environment in which this routine runs: * * - PSW Key ZERO, Supervisor state * * - as an IRB on the Initiator's TCB (not the job step TCB) * * Note: The job step TCB has been Status Stopped before this * * routine runs. This does not mean however that the job * * step TCB is not itself still running concurrent with us. * * ###################################################### * * # FOR THIS REASON, DO NOT SCAN OR LOOK AT IMS SYSTEM # * * # CONTROL BLOCKS. # * * ###################################################### * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * EJECT USING DFSUTL,R15 Temporary base B BEGIN DC CL8'DFSUTL ' DC CL8'&SYSDATE' BEGIN STM R14,R12,12(R13) Save registers LR R12,R15 Load base register DROP R15 Drop temporary base USING DFSUTL,R12 Establish module base reg SPACE 1 FINDIMS DS 0H L R10,76 Load address of CVT at HEX 4C L R10,0(R10) Address of TCB,TCB,ASCB,ASCB L R9,12(R10) Address of current ASCB L R10,108(R9) Load address of AXCB L R10,4(R10) Address of first TCB * LATTCB DS 0H Look At This TCB L R9,36(R10) Load address of 1st LLE this TCB * LATLLE DS 0H Look At This LLE LTR R9,R9 End of LLE chain? BZ LANTCB Yes, go look at next TCB L R8,LLECDPT-LLE(R9) Load CDE pointer LTR R8,R8 Is CDE pointer zero? BZ LANLLE Strange, go look at next LLE * CLC CDNAME-CDENTRY(8,R8),=C'DFSPRPX0' Check for IMS PARMBLK BE FOUNDIMS Branch if we found it * LANLLE DS 0H L R9,LLECHN-LLE(R9) Get next LLE address B LATLLE Go look at this LLE * LANTCB DS 0H Look At Next TCB L R10,116(R10) Load address of next TCB LTR R10,R10 Is there another one? BNZ LATTCB Yes, go look at this TCB * * NO MORE TCB'S IN THIS ASID * IMS WAS NOT FOUND, GO LET THE S322/S522 HAPPEN * B LETITDIE Go return RC=0 SPACE 2 * * THIS IS AN IMS ADDRESS SPACE * R10 = TCB * FOUNDIMS DS 0H IMS is in this ASID L R7,112(,R10) TCB first save area L R7,24(,R7) REG 1 from save area CLC 0(4,R7),=CL4'ECP ' Online dep rgn or BATCH? *** * NOTE: The existance of ECP tells us this is an online region * IFP, BMP, or MPP. The TCB first save area's R1 points * at parmblk directly in DLI/DBB Batch and all utilities. * If you want batch and utility jobs to timeout, move the * label NOECP down to LETITDIE. The following test of * application in control will sometimes let DLI/DBB Batch * continue. Batch utilities will always die. *** BNE NOECP Go if BATCH/UTILITY L R7,304(,R7) X'130' IN ECP FIXED BY ARCHITECTURE NOECP DS 0H TM 266(R7),X'80' X'10A' IN LIPARMS FIXED BY ARCH BNO MORETIME BR IF DLI CALL IN PROGRESS * LETITDIE DS 0H LET THE S322/S522 HAPPEN LM R14,R12,12(R13) RESTORE CALLER'S REGISTERS SLR R15,R15 RC=0 FOR NO MORE TIME BR R14 RETURN SPACE 2 MORETIME DS 0H LET IT KEEP RUNNING L R15,TWOSECS TWO SECS OF CPU IS A LOT CL R0,=F'8' WAIT TIME EXCEEDED? BNE NOTWAIT GO IF NOT WAITTIME L R15,TWOMINS WE DON'T NEED TO DO THIS OFTEN NOTWAIT DS 0H L R14,12(R13) RESTORE REG 14 LM R0,R12,20(R13) AND REGS 0-12 LR R1,R15 ADDITIONAL TIME TO R1 LA R15,4 MORE TIME TO BE GIVEN RC BR R14 RETURN EJECT LTORG * TUPERSEC EQU 1000000/26 TIMER UNITS PER SECOND SECINMIN EQU 60 SECONDS IN MINUTE SPACE 1 TWOSECS DC A(2*TUPERSEC) 2 SECONDS OF TIMERUNITS TWOMINS DC A(2*TUPERSEC*SECINMIN) 2 MINUTES IN TIMERUNITS * * R0 EQU 0 R1 EQU 1 R2 EQU 2 R3 EQU 3 R4 EQU 4 R5 EQU 5 R6 EQU 6 R7 EQU 7 R8 EQU 8 R9 EQU 9 R10 EQU 10 R11 EQU 11 R12 EQU 12 R13 EQU 13 R14 EQU 14 R15 EQU 15 SPACE 2 PRINT NOGEN IHALLE IHACDE IKJTCB SYS=AOS2 CVT DSECT=YES IHAPSA PRINT GEN END