IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Srchfor in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Prosenjit001

New User


Joined: 02 Nov 2011
Posts: 14
Location: India

PostPosted: Thu Jan 05, 2012 3:23 pm
Reply with quote

need a rexx to find the list of source pgm using a particular copybook . the PDS having source pgms is huge . hence while using find command using isredit macro on each member , taking lot of time .

Could anyone can help on this . I was thinking of trap the output of srchfor , but not sure how to use it i rexx .

Any sort of example would be helpful .
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 05, 2012 3:33 pm
Reply with quote

just meditate ...
srchfor and superc write the results to
<user>.SRCHDSL.LIST
<user>.SUPERC.LIST

invoke srchfor/superc and after that process the relative dataset
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 05, 2012 3:41 pm
Reply with quote

but...

ISPF already provides a tool for that
it is called MEMBER PARTS LIST
( foreground/batch option 12 )

it provides a cross reference both for copybooks and statically called subroutines

in two formats,
formatted ( to be browsed)
<raw> to be processed by a user <program>

no need to reinvent the wheel

also as an alternative use Your source control system ...
all of them usually provide cross referencing facilities
Back to top
View user's profile Send private message
Prosenjit001

New User


Joined: 02 Nov 2011
Posts: 14
Location: India

PostPosted: Thu Jan 05, 2012 4:19 pm
Reply with quote

could you please give the syntax to invoke srchfor ..
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jan 05, 2012 4:44 pm
Reply with quote

What have you tried yourself, and what results did you get ?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Jan 05, 2012 8:00 pm
Reply with quote

Use the following commands:
"ALLOC" to allocate all necessary input and output files.
"EXECIO" to write your search-for process statements.
"CALL" to run super-search.
"EXECIO" to read the search-for results.
"FREE" to release the allocated files.

Now, you must do some work before you can get more information from me icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 05, 2012 8:24 pm
Reply with quote

look at ISP.SISPCLIB(ISRSSRCH)
to see how ISPF itself does it and convert the relevant statements to rexx
simple to understand, implement, bulletproof
icon_cool.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Jan 05, 2012 10:42 pm
Reply with quote

It is not clear from the examples given, but when you invoke the ISRSUPC program, the SYSIN file needs to have something like this:
Code:
SRCHFOR  'MYTEXT'         

which will specify what text to search for.

My suggestion is to use ISPF option 3.14 and specify "execution mode' as 'batch'. It will build a batch job for you. Your task is to implement the equivalent of the batch job but in a rexx program. As Marso pointed out, use ALLOC and EXECIO to build the inputs for the searchfor program.
Back to top
View user's profile Send private message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 202
Location: Toronto, ON, Canada

PostPosted: Fri Jan 06, 2012 12:23 am
Reply with quote

Prosenjit001 wrote:
need a rexx to find the list of source pgm using a particular copybook . the PDS having source pgms is huge . hence while using find command using isredit macro on each member , taking lot of time .

If all you want is a list of members then you don't need a Rexx. Use the ISPF Super Search facility. From the primary menu select option 3 (Utilities) and then select the option for "Search-ForE" for the Extended Search-for Utility.
Type 'P' on the command line to bring up a menu of process options. I suggest to use options DPCBCMT IDPFX NOPRTCC so that it ignores COBOL comments and formats the output nicely.
On the bottom of the screen set "Execution mode" to 2.Batch. It will generate JCL for the search. It will then give the option to send the results to a dataset or to held output.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top