/* REXX -- converted to REXX on 1994/06/03 ------------------*/ ADDRESS "ISREDIT" /*KILL Author: David McRitchie, created 1985/12/31 IS03 */ /* << See NOTE at bottom from Kenneth Tomiak >> */ /* at "The REXX Macros Toolbox", DMcRitchie@hotmail.com */ /* Updated 1991/11/08 11:39 IS03 */ /* KILL DELETES INDICATED MEMBER FROM THE PDS BEING EDITED */ /* can delete same member as currently under edit, in which*/ /* case you should terminate the currrent edit with CANCEL */ /* to prevent saving member if CHANGED flag is on. */ /* created by David McRitchie, 1985/12/30 phone */ /* ==========================================================*/ /* defect notice: discovered 1987/04/17 */ /* Can find no way of determining whether user came into */ /* ISPF EDIT using the cataloged version or specified a vol*/ /* ser. In any case passing a DATAID apparently does not */ /* include the volume. If a member does not exist in the */ /* cataloged version, but does exist in the one being viewed*/ /* -- clist will FAIL since member not found. Likewise */ /* this clist will delete a member by the same dsname as */ /* specified from the cataloged version which could be more*/ /* serious. /* << See NOTE at bottom from Kenneth Tomiak >> */ /* cautions: */ /* The reason the member must be specified is to reduce the*/ /* risk of a mass slaughter by inadvertent IMACRO usage. */ /* problem: */ /* ISPF EDIT does not use it-s own library services to pass*/ /* the volume id to the DATAID. */ /*mini-version: ================================================ */ /* "MACRO (KILLMEMB)" ---- MEMBER to delete */ /* "(DSN) = DATASET" ---- obtain dsname w/o quotes */ /* Address "ISPEXEC" --- for following ISPEXEC commands */ /* "LMINIT DATAID(DKILL) DDNAME(&DKILLD) ENQ(SHRW)" */ /* "LMOPEN DATAID(&DKILL) OPTION(OUTPUT) ORG(POCHK) -- Open" */ /* "LMMDEL DATAID(&DKILL) MEMBER(&KILLMEMB) -- kill member" */ /* "LMCLOSE DATAID(&DKILL) ---- Close dataid " */ /* "LMFREE DATAID(&DKILL) --free dataid assigned by LMINIT" */ /* ============================================================= */ "MACRO (KILLMEMB)" /* MEMBER to delete */ KILLMEMB = translate(KILLMEMB) /* capitalized parameter*/ /*................ (#VER) ............*/ parse version v1 v2 v3 if v1 = "REXX370" then Nop; else do; say "kill is only for TSO, sorry"; exit 12; end /* ...................................*/ "(DSN) = DATASET" "(DKILLD) = DATAID" /* obtain dataid */ Address "ISPEXEC" /* -- default there are no ISREDIT instruct.*/ IF KILLMEMB = "" THEN DO ZEDSMSG = "MISSING" MEMBER ZEDLMSG= "MEMBERNAME to be deleted from" DSN "was NOT SPECIFIED" "SETMSG MSG(ISRZ001)" address "TSO" "CLS" error = "ERROR -- ERROR --" SAY ERROR "FROM ATTEMPT TO INVOKE THE ""KILL"" MACRO" SAY ERROR "MEMBERNAME TO BE DELETED" , "FROM" DSN "WAS NOT SPECIFIED" SAY ERROR "MEMBERNAME TO BE DELETED", "FROM" DSN "WAS NOT SPECIFIED" Exit 0 END "LMINIT DATAID(DKILL) DATASET('&DSN.') ENQ(SHRW)" rcx = RC IF rcx \= 0 THEN DO address "TSO" "CLS" SAY "Address ""ISPEXEC"" ""LMINIT DATAID(DKILL)", "DATASET('"DSN"') ENQ(SHRW)" SAY "KILL -- LMINIT DATAID not assigned rcx="rcx Exit rcx END "LMOPEN DATAID(&DKILL) OPTION(OUTPUT) ORG(POCHK)" /* Open dataid for output (line above) */ LMRC = RC IF LMRC \= 0 THEN signal CLOSEX IF POCHK \= "PO" THEN signal CLOSEX IF LMRC = 0 THEN DO "LMMDEL DATAID(&DKILL) MEMBER(&KILLMEMB) /* kill member */" LRC = RC IF LRC = 0 THEN DO ZEDSMSG = KILLMEMB "deleted" ZEDLMSG = KILLMEMB "deleted from" dsn, "per your request via ""KILL" KILLMEMB"""" "SETMSG MSG(ISRZ000)" SAY " COMPLETED OK -- DELETED MEMBER " KILLMEMB, "FROM" DSN "PER YOUR REQUEST VIA ""KILL" KILLMEMB"""" END IF LRC = 8 THEN DO ZEDSMSG = KILLMEMB "NOT FOUND" ZEDLMSG = KILLMEMB "NOT FOUND, REQUEST,", "NOT COMPLETED, for ""KILL" KILLMEMB "SETMSG MSG(ISRZ000)" SAY " "KILLMEMB" NOT FOUND IN "DSN"," , "REQUEST NOT COMPLETED, PER ""KILL" KILLMEMB"""" END IF lrc > 0 then do ZEDSMSG = ZERRSM ZEDLMSG = ZERRMSG strip(ZERRLM)", rc="lrc "SETMSG MSG(ISRZ001)" SAY "KILL" killmemb "-- via LMMDEL failed RC="lrc", because" SAY " "zerrmsg strip(zerrlm)", rc="lrc END END /* return next member name */ CLOSEX: "LMCLOSE DATAID(&DKILL) /* Close dataid */" "LMFREE DATAID(&DKILL) /*finished with LMINIT assigned */" Exit 0 /* ************************************************************** ************************************************************** Updates can be included, received email from Kenneth Tomiak 2007-08-07 concerning the Defect notice: (so am just including the message rather than any actual update, sorry but it's been a long time since I was on a mainframe) ISPF has progressed if you wish to update your edit macros. Not sure how far back, but in z/OS 1.7: Address IsrEdit "(volser1,volcnt,volsero) = VOLUME" vol_rc = RC Say "VOL="volser1", Origination("volsero"), VOL#"volcnt"." If (vol_rc = 4) then, do Address IspExec "VGET (ZEDMVOL)" say "volsers="ZEDMVOL"." end ************************************************************** ************************************************************** */