/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : DELSTATS */ /* */ /* Description : Delete the ISPF Statistics from a dataset. */ /* */ /* Created on : 31 Mar 2018 */ /* Created by : KEVIN FERGUSON */ /* : Userid(MIT001) */ /* : using ABBYDALE.XFER.REXX(DELSTATS) */ /* */ /* Called by : */ /* */ /* Calls : LISTDSI */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ parse upper arg dsn dialogid = sysvar(sysicmd) parse source Exec_String excnme = word(Exec_String,3) /* Get EXEC's name */ address ISPEXEC "CONTROL ERRORS RETURN" do while dsn = "" Say 'Enter Dataset Name. (use QUIT to terminate)' pull xsn if xsn = 'QUIT' then exit if xsn = 'END' then exit DSN_STATUS = LISTDSI(''''xsn'''' smsinfo) if sysrecfm <>"U" then do if sysdsorg == "PO" then do dsn = xsn end end if dsn <> xsn then do say 'invalid dataset type for' excnme end end dsn = strip(dsn,b,"'") kf =outtrap('on') DSN_STATUS = LISTDSI(''''dsn'''' smsinfo) rc = 8 if sysrecfm <>"U" then do if sysdsorg = "PO" then do address ISPEXEC "LMINIT DATAID(RES) DATASET('"dsn"') ENQ(SHR)" if rc <> 0 then say 'LMINIT error' zerrlm address ISPEXEC "LMMSTATS DATAID("RES") MEMBER(*) DELETE" if rc <> 0 then say 'LMSTAT error' zerrlm address ISPEXEC "LMFREE DATAID("RES")" if rc <> 0 then say 'LMFREE error' zerrlm ZEDSMSG = 'Stats deleted' ZEDLMSG = 'ISPF stats deleted from 'dsn ZDLMSG = 'Stats deleted' ZDLREF = 'Y' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" address ISPEXEC "SETMSG MSG(ISRZ001)" end end kf =outtrap('off') if rc = 8 then do Say excnme 'only works on PDS datasets' ZEDSMSG = excnme 'failed' ZEDLMSG = dsn 'is the wrong dataset type' ZDLMSG = "Invalid type" ZDLREF = 'Y' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" address ISPEXEC "SETMSG MSG(ISRZ001)" exit rc end exit rc /*-------------------------------------------------------------------*/ /* End of DELSTATS */ /*-------------------------------------------------------------------*/