/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : FINDREXX */ /* */ /* Description : Checks for the existance of a REXX EXEC in the */ /* SYSEXEC or SYSPROC concatenation */ /* */ /* Created on : 31 Jul 2003 */ /* Created by : Kevin Ferguson */ /* : Userid MIT001 */ /* : Using ABBYDALE.PROD.REXX(FINDREXX) */ /* */ /* Called by : ALIKE, MQDISP */ /* */ /* Calls : SYSDSN */ /* */ /* Panels Used : None */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ Parse Arg Help /* Check for Help */ ISPF = "Y" If SYSVAR("SYSISPF")<>"ACTIVE" then do ISPF = "N" end if ISPF = "Y" then do Address ISREDIT "MACRO (Help) PROCESS" End If Help = "?" then do Call Disp_Help exit(4) end Mac = "N" if ISPF = "Y" then do Address ISREDIT "(mac) = MACRO_LEVEL" if mac <> "MAC" then do Mac = "Y" end end signal on novalue /* un-initialized vars*/ signal on halt /* attention key */ Mbr = Help doit = "n" tcb = ptr(540) /* Address of TCB (PSATOLD) */ jscb = ptr(tcb+180) /* Jscb tcbjscb */ tiot = ptr(tcb+12) /* Address of TIOT (TCBTIO) */ tioentry = tiot+24 /* Address of 1st TIOT entry */ tioelngh = C2D(stg(tioentry, 1)) /* TIOT entry length */ parse upper var Mbr Mbr mrc = 8 found = 0 do until tioelngh == 0 thisddname = strip(stg(tioentry+4,8)) if left(thisddname, 1) == '00'x then do /* Valid DD entry? */ tioentry = tioentry+tioelngh /* Next TIOT entry */ tioelngh = c2d(stg(tioentry, 1)) /* TIOT entry length */ iterate end if left(thisddname, 1) \= ' ' then do /* a new DD found */ select When thisddname = "SYSEXEC" then do myddn = thisddname doit = "y" end When thisddname = "SYSPRIC" then do myddn = thisddname doit = "y" end otherwise doit="n" end end if doit = "y" then do /* Is it ours? */ svatoken = stg(tioentry+12,3) /* TIOEJFCB SVA address token*/ jfcb = swareq(svatoken) /* Convert into JFCB address */ dsname = stg(jfcb, 44) /* dataset name */ dsname = strip(dsname,'T') TrapON=OutTrap('ON') DSN_STATUS = SYSDSN("'"dsname||'('||Mbr||')'"'") TrapON=OutTrap('OFF') if DSN_STATUS = 'OK' then do found = found + 1 if Mac = "Y" then do ZEDSMSG = Mbr "Found" ZEDLMSG = Mbr "found in" dsname ZDLREF = 'Y' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" Address ISPEXEC "SETMSG MSG(ISRZ001)" mrc = 0 exit mrc end end end tioentry = tioentry+tioelngh /*Next TIOT entry*/ tioelngh = c2d(stg(tioentry, 1)) /*TIOT entry length */ end If Mac = "Y" then do ZEDSMSG = Mbr "Not found" ZEDLMSG = Mbr "Not found in SYSEXEC nor SYSPROC concatentaions" ZDLREF = 'Y' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" Address ISPEXEC "SETMSG MSG(ISRZ001)" end EXIT mrc ptr: Return C2D(storage(D2X(ARG(1)),4)) stg: Return storage(d2x(arg(1)),arg(2)) swareq: parse arg svatoken if right(c2x(svatoken),1) \= 'F' then /* Swa=Below ? */ thisjfcb = c2d(svatoken)+16 else do /* SWA is above 16MB line. */ sva = c2d(svatoken) /* Convert to decimal */ nextqmat = qmat do while sva>65536 nextqmat = ptr(nextqmat+12) /* Next qmat qmat+12 */ sva=sva-65536 /* 010006F -> 000006F */ end thisjfcb = ptr(qmat+sva+1)+16 /* JFCB in 31 bit address */ end return thisjfcb /*-------------------------------------------------------------------*/ /* Disp_Help Procedure */ /*-------------------------------------------------------------------*/ Disp_Help: Procedure say "FINDREXX - Checks for the existance of a REXX exec" say"" say "Usage: FINDREXX xxxxx | ?" say"" say" ? - Generates this information." say"" say" Return Codes :" say" 0 - Rexx found" say" 4 - Help displayed" say" 8 - Rexx not found" say"" Return /*-------------------------------------------------------------------*/ /* End of Disp_Help Procedure */ /*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/ /* Trap NOVALUE Condition */ /*-------------------------------------------------------------------*/ novalue: say "NOVALUE entered from line" sigl say condition("D") say "The instruction is suppressed" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of FINDREXX */ /*-------------------------------------------------------------------*/