/* Rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : REXXIT */ /* */ /* ***** Edit Macro ***** */ /* */ /* Description : Add a boilerplate and some standard 'traps' to */ /* a REXX exec. If the member being processed already */ /* has a rexx definition then the boilerplate is */ /* inserted after it. */ /* */ /* The macro will define a NOVALUE and HALT section */ /* in the member. */ /* */ /* Created on : 22 Mar 2018 */ /* Created by : Kevin Ferguson */ /* : Userid MIT001 */ /* : Using ABBYDALE.DEVL.EMACS(REXXIT) */ /* */ /* Called by : Edit Macro */ /* */ /* Calls : USERNAME and indirectly PROPER */ /* */ /* Panels Used : None */ /* */ /* Change Activity : */ /* */ /* MM/DD/YYYY ID Comment */ /* --------------------------------------------------------------- */ /* 05/16/2021 DSF Added panels used information to the both the */ /* macro and the boilerplate that ets created. */ /* */ /* 05/17/2021 RRR Added ability to generate an Edit Macro */ /* skeleton. */ /* */ /* 05/19/2021 ISP Added disp_help procedure and check for ISPF */ /* */ /* 05/20/2021 USR Removed name processing to external EXEC */ /* */ /* 06/26/2021 --- Removed duplicate novalue label */ /* */ /* 07/22/2023 EXC Added exec name variable in case of alias use */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ parse upper ARG EMAC /*RRR*/ If SYSVAR('SYSISPF')<>'ACTIVE' then do /*ISP*/ Say 'ISPF must be running to use this exec' /*ISP*/ exit(16) /*ISP*/ end /*ISP*/ ADDRESS ISREDIT "MACRO (EMAC) PROCESS" /*RRR*/ ADDRESS ISREDIT "(DSNAME) = DATASET" ADDRESS ISREDIT "(MEMBER) = MEMBER" ADDRESS ISREDIT '(LASTLINE) = LINENUM .ZLAST' if lastline > 0 then ADDRESS ISREDIT "(LINE) = LINE 1" address ISredit "Profile unlock" address ISredit "HILITE REXX" address ISredit "Profile lock" ADDRESS ISREDIT "RESET" uline = translate(LINE) rexx = 'N' If INDEX(uline,'REXX') > 0 then do ZEDSMSG = 'Already Rexx' ZEDLMSG = 'Member' member 'will only have the boiler plate added' ADDRESS ISPEXEC "SETMSG MSG(ISRZ000)" rexx = 'Y' /* exit (0) */ end s = USERID() /*ascb = storage(224,4) psaaold USR*/ /*asxb = storage(d2x(c2d(ascb)+108),4) ascbasxb USR*/ /*acee = storage(d2x(c2d(asxb)+200),4) acee USR*/ /*unam = storage(d2x(c2d(acee)+100),4) aceeunam USR*/ /*name=strip(storage(d2x(c2d(unam)+1),24)) Get name USR*/ username xname /*USR*/ parse pull xname /*USR*/ name = Strip(xname,b,'"') /*USR*/ row = 0 if rexx = 'N' then do Address ISREDIT "LINE_AFTER "row "= '/* rexx */'" end row = row + 1 fill = '-' tline = '-' call putline fill = ' ' tline = ' ' call putline tline = 'REXX Exec : 'member call putline if EMAC <> "" then do /*RRR*/ fill = ' ' /*RRR*/ tline = ' ' /*RRR*/ call putline /*RRR*/ tline = '***** Edit Macro *****' /*RRR*/ call putline /*RRR*/ end /*RRR*/ tline = ' ' call putline tline = 'Description :' call putleft tline = ' ' call putline tline = 'Created on : 'date() call putleft tline = 'Created by : 'name call putleft tline = ' : Userid 's call putleft tline = ' : Using' dsname'('member')' call putleft tline = ' ' call putline tline = 'Called by :' call putleft tline = ' ' call putline tline = 'Calls :' call putleft tline = ' ' /*DSF*/ call putline /*DSF*/ tline = ' ' /*DSF*/ tline = 'Panels Used :' /*DSF*/ call putleft /*DSF*/ tline = ' ' /*DSF*/ call putline /*DSF*/ tline = 'Change Activity :' call putleft tline = ' ' call putline tline = '©Copyright of Abbydale Systems LLC.' call putline tline = ' ' call putline fill = '-' tline = '-' call putline mline = 'Parse Arg Help /* Check for Help */' /*ISP*/ call putcode /*ISP*/ mline = 'dialogid = sysvar(sysicmd)' /*EXC*/ call putcode /*EXC*/ mline = 'parse source Exec_String ' /*EXC*/ call putcode /*EXC*/ mline = 'excnme = word(Exec_String,3)' /*EXC*/ call putcode /*EXC*/ mline = 'If SYSVAR("SYSISPF")<>"ACTIVE" then do' /*ISP*/ call putcode /*ISP*/ mline = ' Say "ISPF must be active to use "'member /*ISP*/ call putcode /*ISP*/ mline = ' exit(16)' /*ISP*/ call putcode /*ISP*/ mline = 'end' /*ISP*/ call putcode /*ISP*/ if EMAC <> "" then do /*RRR*/ mline = 'Address ISREDIT "MACRO (Help) PROCESS"' /*ISP RRR*/ call putcode /*RRR*/ end /*RRR*/ mline = 'If Help = "?" Then do' /*ISP*/ call putcode /*ISP*/ mline = ' Call Disp_Help' /*ISP*/ call putcode /*ISP*/ mline = ' exit(4)' /*ISP*/ call putcode /*ISP*/ mline = 'end' /*ISP*/ call putcode /*ISP*/ mline = 'signal on novalue /* un-initialized vars*/ ' call putcode mline = 'signal on halt /* attention key */ ' call putcode mline = 'return' /*ISP*/ call putcode /*ISP*/ ADDRESS ISREDIT '(LASTLINE) = LINENUM .ZLAST' row = lastline fill = '-' /*ISP*/ tline = '-' /*ISP*/ call putline /*ISP*/ fill = ' ' /*ISP*/ tline = 'Disp_Help Procedure' /*ISP*/ call putline /*ISP*/ fill = '-' /*ISP*/ tline = '-' /*ISP*/ call putline /*ISP*/ fill = ' ' /*ISP*/ mline = 'Disp_Help: Procedure EXPOSE excnme' /* ISP EXC */ call putcode /*ISP*/ mline = '$nam2$ = RIGHT($nam2$,8," ")' /*EXC*/ call putcode /*EXC*/ mline = 'say "$name$ -"' /* ISP EXC */ call putcode /*ISP*/ mline = 'say""' /*ISP*/ call putcode /*ISP*/ mline = 'say "Usage: $name$ xxxxx | ?"' /* ISP EXC */ call putcode /*ISP*/ mline = 'say""' /*ISP*/ call putcode /*ISP*/ mline = 'say" ? - Generates this information."' /*ISP*/ call putcode /*ISP*/ mline = 'say""' /*ISP*/ call putcode /*ISP*/ mline = 'say" Return Codes :"' /*ISP*/ call putcode /*ISP*/ mline = 'say" 4 - Help displayed"' /*ISP*/ call putcode /*ISP*/ mline = 'say" 16 - Not under ISPF"' /*ISP*/ call putcode /*ISP*/ mline = 'say""' /*ISP*/ call putcode /*ISP*/ mline = 'Return' /*ISP*/ call putcode /*ISP*/ fill = '-' /*ISP*/ tline = '-' /*ISP*/ call putline /*ISP*/ fill = ' ' /*ISP*/ tline = 'End of Disp_Help Procedure' /*ISP*/ call putline /*ISP*/ fill = '-' /*ISP*/ tline = '-' /*ISP*/ call putline /*ISP*/ tline = '-' call putline fill = ' ' tline = 'Trap NOVALUE Condition' call putline fill = '-' tline = '-' call putline fill = ' ' mline = 'novalue:' call putcode mline = 'say "NOVALUE entered from line" sigl' call putcode mline = 'say condition("D")' call putcode mline = 'say "The instruction is suppressed"' call putcode mline = 'address "TSO"' call putcode mline = '"delstack"' call putcode mline = 'exit(16)' call putcode fill = '-' tline = '-' call putline fill = ' ' tline = 'Trap HALT Condition' call putline fill = '-' tline = '-' call putline fill = ' ' mline = 'halt:' call putcode mline = 'say "HALT acknowledged in line" sigl ' call putcode mline = 'say "Cleanup processing in progress"' call putcode mline = 'address "TSO"' call putcode mline = '"delstack"' call putcode mline = 'exit(16)' call putcode fill = '-' tline = '-' call putline fill = ' ' tline = 'End of 'member call putline fill = '-' tline = '-' call putline Address ISREDIT 'CHANGE ALL $name$ ""excnme ""' /*EXC*/ Address ISREDIT 'CHANGE ALL $nam2$ "excnme"' /*EXC*/ Address TSO "ISREDIT RESET" /*EXC*/ exit putline: mline = '/*'CENTER(tline,67,fill)'*/' Address ISREDIT "LINE_AFTER "row "= '"mline"'" row = row + 1 return putleft: mline = '/* 'LEFT(tline,65,fill)'*/' putcode: Address ISREDIT "LINE_AFTER "row "= '"mline"'" row = row + 1 return /*-------------------------------------------------------------------*/ /* End of REXXIT */ /*-------------------------------------------------------------------*/