just to warn You about what You are trying to attempt
here a quick and dirty snippet
to extract from an exec statement the parms being used
IT IS WRITTEN AS AN EDIT MACRO
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace "O"
Parse Source _sys _how _cmd .
_ack = 1
If ( Sysvar(SYSISPF) \= "ACTIVE" ) Then Do
Say left(_cmd,8)"- Ispf is not active. Command not executed"
exit 4
End
call $ispex "CONTROL ERRORS RETURN"
if ( $isred("MACRO (ARGS) NOPROCESS ") \= 0 ) then do
zedsmsg = "Invocation ERROR"
zedlmsg = left(_cmd,8)"- Must be invoked as a MACRO"
call $ispex "SETMSG MSG(ISRZ001)"
exit 4
end
if ( $isred("PROCESS RANGE S ") = 0 ) then do
call $isred "(XFR) = LINENUM .ZFRANGE "
call $isred "(XTO) = LINENUM .ZLRANGE "
end
else do
call $isred "(XFR) = LINENUM .ZFIRST "
call $isred "(XTO) = LINENUM .ZLAST "
end
stmt.0 = 0
do l = xfr to xto
call $isred "(buff) = LINE" l
j = stmt.0 + 1
stmt.j = left(buff, 71)
stmt.0 = j
end
/* */
ampsnd = "`"
apostr = "~"
wchars = "`~"
jchars = "&'"
/* */
stmt_numb = 0
stmt_name = ""; stmt_oper = ""; stmt_keys = ""
j = 0
do while ( j < stmt.0 )
j = j + 1
buff = stmt.j
if strip(buff) = "/*" | ,
strip(buff) = "//" | ,
substr(buff, 1,3) = "//*" | ,
substr(buff, 1,2) = "/*" | ,
substr(buff, 1,2) \= "//" then ,
iterate
buff = translate(buff, wchars, jchars)
if $scan(buff) then ,
iterate
stmt_keys = stmt_keys || ","
if wordpos(stmt_oper, "PROC EXEC") = 0 then do
stmt_name = ""; stmt_oper = ""; stmt_keys = ""
iterate
end
keyw_coun = 0
posn_coun = 0
keyw_name = ""
keyw_data = ""
keyw_tabl = ""
do while ( stmt_keys \= "" )
keyw_name = $keyw(stmt_keys)
if keyw_name = "$" then do
posn_coun = posn_coun + 1
keyw_name = "POSIT" || posn_coun
end
interpret stmt_oper"."keyw_name "= '"keyw_data"' "
keyw_coun = keyw_coun + 1
keyw_tabl = keyw_tabl stmt_oper"."keyw_name
end
say "*******" ">>>>>"stmt_oper"<<<<<"
if stmt_oper = "JOB" then do
jobname = stmt_name
end
if stmt_oper = "EXEC" then do
stepname = stmt_name
if symbol("exec.proc") = "LIT" then do
exec.proc = exec.posit1
keyw_tabl = keyw_tabl "EXEC.PROC"
drop exec.posit1
end
end
vv = keyw_tabl
do i = 1 to words(vv)
v = word(vv, i)
if symbol(v) = "VAR" then ,
say left(v, 20) value(v)
end
stmt_name = ""; stmt_oper = ""; stmt_keys = ""
end
if ( _ack = 1 ) then do
zedsmsg = left(_cmd,8)"- Ended"
zedlmsg = left(_cmd,8)"- Ended"
call $ispex "SETMSG MSG(ISRZ001) "
end
Exit 0
/* */
$tsoex:
tso_0tr = trace("O")
Address TSO arg(1)
tso_0rc = rc
trace value(tso_0tr)
return tso_0rc
/* */
$ispex:
isp_tr = trace("O")
Address ISPEXEC arg(1)
isp_rc = rc
trace value(isp_tr)
return isp_rc
/* */
$isred:
isr_tr = trace("O")
Address ISREDIT arg(1)
isr_rc = rc
trace value(isr_tr)
return isr_rc
/* */
$Scan:Procedure expose apostr ampsnd ,
stmt_name ,
stmt_oper ,
stmt_keys
buff = arg(1)
p = pos("PARM.",buff)
if p \= 0 then ,
buff = overlay("PARM^",buff,p,5)
if stmt_name = "" then do
if substr(buff,3,1) = " " then do
stmt_name = "NONAME"
buff = strip(substr(buff,3))
end
else do
stmt_name = strip(word(substr(buff,3),1))
buff = strip(substr(buff,3))
buff = strip(delword(buff,1,1))
end
stmt_oper = word(buff,1)
buff = strip(delword(buff,1,1)) || " "
end
else do
buff = strip(substr(buff,3)) || " "
end
_b = 1
_a = pos(apostr,buff)
do while ( _a > 0 )
_b = _a
_a = pos(apostr,buff,_b+1)
end
_b = pos(" ",buff,_b+1)
buff = strip(substr(buff,1,_b))
stmt_keys = stmt_keys || buff
if right(stmt_keys, 1) = "," then ,
return 1
else
return 0
return -99
/* */
$Keyw:Procedure Expose ampsnd apostr ,
stmt_keys ,
keyw_data
buff = Arg(1)
Select
When Left(buff,1) = apostr | ,
Left(buff,1) = "(" Then do
l_kwrd = 0
i_parm = 1
l_Skip = 1
keyw = "$"
end
When Pos("=",buff) = 0 | ,
Pos("=",buff) <> 0 & ,
Pos(",",buff) < Pos("=",buff) Then do
l_kwrd = 0
i_parm = 1
l_Skip = 1
keyw = "$"
end
Otherwise do
l_kwrd = Pos("=",buff) - 1
i_parm = Pos("=",buff) + 1
l_Skip = 1
keyw = Left(buff,l_kwrd)
end
end
Select
When Substr(buff,i_parm,1) = "(" Then do
z_parm = Pos(")",buff,i_parm+1)
i_Skip = Pos("(",buff,i_parm+1)
do while (i_Skip <> 0 & ,
i_Skip < z_parm)
z_parm = Pos(")",buff,z_parm+1)
i_Skip = Pos("(",buff,i_skip+1)
end
l_parm = z_parm - i_parm + 1
end
When Substr(buff,i_parm,1) = apostr Then do
z_parm = Pos(apostr,buff,i_parm+1)
do while Substr(buff,z_parm+1,1) = apostr
z_parm = Pos(apostr,buff,z_parm+2)
end
l_parm = z_parm - i_parm + 1
end
Otherwise do
z_parm = Pos(",",buff,i_parm) - 1
l_parm = z_parm - i_parm + 1
end
end
keyw_data = Substr(buff,i_parm,l_parm)
stmt_keys = Delstr(buff,1,z_parm+l_Skip)
Return keyw
which when run against
****** ***************************** Top of Data ******************************
000001 // EXEC SOMEPROC,PARM1=AAAA,PARM2=BBBBB
000002 // EXEC PROC=SOMEOTHR,ZQW12LOP=WWWWWW,QWQWQ=KKKKK
000003 // EXEC PROC=OTHROTHR,ZQW12LOP=WWWWWW,QWQWQ=KKKKK,
000004 // QQQQQQQQ=WWWWWW,XXXXX=KKKKK
****** **************************** Bottom of Data ****************************
will return
******* >>>>>EXEC<<<<<
EXEC.PARM1 AAAA
EXEC.PARM2 BBBBB
EXEC.PROC SOMEPROC
******* >>>>>EXEC<<<<<
EXEC.PROC SOMEOTHR
EXEC.ZQW12LOP WWWWWW
EXEC.QWQWQ KKKKK
******* >>>>>EXEC<<<<<
EXEC.PROC OTHROTHR
EXEC.ZQW12LOP WWWWWW
EXEC.QWQWQ KKKKK
EXEC.QQQQQQQQ WWWWWW
EXEC.XXXXX KKKKK
***
frankly You are trying to eat a sandwich too big for Your mouth
If you help me we can do it in phases and finish it..
what kind of help do You expect ...
more code lines for each phase
so that at the end You have been sitting doing nothing
and I have written the tool for You