View previous topic :: View next topic
|
Author |
Message |
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi everyone,
I have tried ro develop a tool which actually searchs all available proclib for string and put the results along with member name where the string found, using a superc thru JCL.
But i noticed running a JCL and ISPF 3.4 SRCHFOR both are taking same time to produce results.
Here I would like to copy macro of TSO command SRCHFOR and do a little modifications for an effective and clear output.
Could any please tell me where the TSO SRCHFOR macro resides. Or macro of SRCHFOR.
Thanks in advance,
Basha[/u] |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
SRCHFOR is not a macro, it's one of the many options of the ISRSUPC program written by IBM and the only way you can tailor its output is to use the process options, or to write a program that post-processes the output. |
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi Robert,
Thanks for the reply.
I was thinking in this way SRCHFOR is a TSO co
command which internally calls ISRSUPC.
Correct me if am wrong. May be confused. Please clarify. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi Sambhaji,
Thanks for the link. I got it. Its a primary command like save, cancel etc.
Thanks all |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Khadhar Basha wrote: |
I got it. Its a primary command like save, cancel etc. |
Whatever gave you the impression that it is a primary command??? |
|
Back to top |
|
|
nevilh
Active User
Joined: 01 Sep 2006 Posts: 262
|
|
|
|
Quote: |
Whatever gave you the impression that it is a primary command??? |
Maybe because IBM include it in the list Data set list utility primary commands |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
a little modifications for an effective and clear output. |
What would you like to do differently? |
|
Back to top |
|
|
Jan Leo
New User
Joined: 16 Jan 2015 Posts: 2 Location: Germany
|
|
|
|
Hi Khadar !
Perhaps the following rexx code may help you. You can add it into your TSO sessions command procedure contatenated library e.g. as member SPJSRCH.
Calling it with TSO SPJSRCH library_name search_argument(s) will provide you with a list shown with ISPEXEC VIEW containing one line per member in a Format:
library_name(member)
Code: |
/* rexx =============================================================*/
/* */
/* %SPJSRCH means: call with TSO SPJSRCH ... */
/* */
/* Examples: */
/* */
/* -------- - library -- - search argument - */
/* %SPJSRCH SYS1.SAMPLIB ample JCL */
/* %SPJSRCH SYS1.SAMPLIB ' sample JCL ' */
/* %SPJSRCH SYS1.PARMLIB 'IEASYM' */
/* %SPJSRCH ISP.SISPPENU Compilers */
/* */
/* The search argument is case sensitive */
/* Quotes me be useful for leading/trailing blanks */
parse arg options
options = translate(options," ",",") ; wops = words(options)
if wops < 2 then exit 8
filter = "" ; lino = 0 ; att = 0 ; mfnd = 0
myproc = sysvar(sysicmd)
tempfx = sysvar(syspref)
supin = word(options,1) ; supino = supin ; upper supin
supin = strip(supin,,"'")
srarg = strip(strip(delword(options,1,1)),,"'",)
help = translate(supin," ","()") ; if words(help) = 2 then do
supin = word(help,1) ; filter = word(help,2) ; end
supsi = "'"tempfx"."myproc".SEQL'"
supout = "'"tempfx"."myproc".LIST'" ; cntl = msg("OFF")
call intsupc "'SRCHCMP,''ANYC'''"
call getres
call viewres
exit /* from SPJSRCH main line ======================================*/
/*-------------------------------------------------------------------*/
intsupc:
parse arg supcop
"FREE FILE(NEWDD)"
"ALLOC FILE(NEWDD) DATASET('"supin"') SHR" ; nrc = rc
"FREE FILE(OUTDD SYSIN)" ; "DELETE" supsi ; "DELETE" supout
"ALLOC FILE(SYSIN) DATASET("supsi") NEW" ; irc = rc
stm.1 = " SRCHFOR '"srarg"'" ; lstm = 1 ; stm.0 = 1
"EXECIO" lstm "DISKW SYSIN (STEM STM. FINIS)" ; "FREE FILE(SYSIN)"
"ALLOC FILE(SYSIN) DATASET("supsi") SHR" ; crc = rc
"ALLOC FILE(OUTDD) DATASET("supout") NEW RECFM(F,B,A) LRECL(121)" ,
"SPACE(600,300) TRACKS" ; arc = rc
"CALL *(ISRSUPC)" supcop ; lrc = rc
"EXECIO * DISKR OUTDD (FINIS STEM ON.)"
"FREE FILE(SYSIN)" ; "DELETE" supsi
return /* from intsupc ----------------------------------------------*/
/*-------------------------------------------------------------------*/
getres:
"EXECIO * DISKR OUTDD (FINIS STEM ON.)"
"FREE FILE(OUTDD)"
call sl left(" /* Dataset:" supino "searched for: ",69," ")"*/"
call sl left(" /*" srarg,69," ")"*/"
do line = 1 to on.0 ; utln = substr(on.line,2)
select
when line = 1 then att = 1
when att then call process
otherwise ; end ; end ; "DELETE" supout
call sl left(" /* Members found:" mfnd,69," ")"*/"
return /* from getres -----------------------------------------------*/
/*-------------------------------------------------------------------*/
process:
help = utln ; upper help
if index(utln,"- STRING(S) FOUND -") = 0 then return
mbrname = word(utln,1)
if filter ^= "" then do
if mbrname ^= filter then crc = 4
if crc ^= 0 then return ; end
mfnd = mfnd + 1
call sl " "supin"("mbrname")"
return /* from process ----------------------------------------------*/
/*-------------------------------------------------------------------*/
viewres:
address "ISPEXEC" ; "VGET (ZSCREEN) SHARED" ; address "TSO"
myprvw = myproc ; if length(myproc) > 7 then myprvw = left(myproc,7)
view = "'"tempfx"."myprvw!!zscreen".SEQL'" ; cntl = msg("OFF")
"DELETE" view ; "FREE FILE(SYSUT2)" ; VIEW. = "" ; vidx = 0
"ALLOC FILE(SYSUT2) DATASET("view") NEW RECFM(F,B) LRECL(255)"
if rc = 0 then do indx = 1 to lino ; if out.indx = "" then iterate
vidx = vidx + 1 ; VIEW.vidx = out.indx ; end
"EXECIO" vidx "DISKW SYSUT2 (STEM VIEW. FINIS)" ; "FREE FILE(SYSUT2)"
"ISPEXEC" "CONTROL ERRORS RETURN"
"ISPEXEC" "VIEW DATASET("view")" ; "DELETE" view
return /* from viewres ----------------------------------------------*/
/*-------------------------------------------------------------------*/
sl:
parse arg output_line
lino = lino + 1 ; out.lino = output_line
return /* from sl ---------------------------------------------------*/
|
To read and check this code should use HILITE REXX under ISPF VIEW/EDIT
|
|
Back to top |
|
|
|