/* REXX STEPS exposes all EXEC statements in JCL. 20071113 fxc handle lines with quoted strings; */ address ISREDIT "MACRO (opts)" upper opts parse var opts "TRACE" tv . parse value tv "N" with tv . rc=Trace("O"); rc = Trace(tv) if Wordpos("?",opts) > 0 then call HELP /* -*/ sw.0full = WordPos("TERSE",opts) = 0 sw.0pgms = WordPos("PGM",opts) > 0 address ISPEXEC "CONTROL ERRORS RETURN" "X ALL" if sw.0pgms then taglist = "EXEC" /* programs only */ else do taglist = "PROC EXEC" "F ALL ' PROC '" end /* */ "F ALL ' EXEC '" if sw.0full then do /* expand all */ "F FIRST '//' NX 1" do forever if rc > 0 then leave "(txt) = LINE .zcsr" /* acquire text */ pt = Pos( "'",txt ) if pt > 0 then do pt2 = Pos( "'",txt,pt+1 ) if pt2 > 0 then do sluglen = pt2-pt-1 slug = Translate( Substr( txt,pt+1,sluglen),'3e'x,' ' ) txt = Overlay( slug,txt,pt+1 ) end end /* quoted string? */ parse var txt front body rest if Wordpos(body,taglist) > 0 then, parse var rest body rest if Left(front,3) = "//*" |, /* comment */ Right(body,1) = "," then do /* continuation */ "(l#) = LINENUM .zcsr" "XSTATUS" l#+1 "= NX" if Left(front,3) = "//*" then, "XSTATUS" l# "= X" end /* continuation */ "F NEXT '//' NX 1" end /* forever */ end /* FULL */ else do /* TERSE */ "F FIRST '//*' NX 1" do forever if rc > 0 then leave "(txt) = LINE .zcsr" /* acquire text */ if Left(txt,3) = "//*" then, "XSTATUS .zcsr = X" "F NEXT '//*' NX 1" end /* forever */ end /* TERSE */ "F ALL ' PEND '" "F FIRST '//' 1 NX" /* position to top */ exit 1 /*@ STEPS */ /* . ----------------------------------------------------------------- */ HELP: /*@ */ address TSO;"CLEAR" ; say parse source . . exec_name . ex_nam = Left(exec_name,8) /* predictable size */ say " "ex_nam" exposes all PROC and EXEC statements in JCL. " say " " say " Syntax: "ex_nam" " say " " say " " say " TERSE shows only the line containing the PROC or EXEC " say " verb. If TERSE is not specified, all lines " say " associated with the PROC or EXEC verb are shown. " say " " say " PGM restricts the operation to EXEC verbs only. " say " " "NEWSTACK"; pull ; "CLEAR" ; "DELSTACK" address ISPEXEC "CONTROL DISPLAY REFRESH" exit /*@ HELP */