Posted: Tue Sep 06, 2011 4:59 pm Post subject: searching a string in members of a pds via rexx
Hi..I am new to the forum.Can anyone guide me to get a code in rexx that would search for a string in members of a pds and write the results (not the member name but the line where it occured along with member name) in a seperate ps.
look in the rexx reference for the example ISRMBRS macro.
you need to 'PUT' your target (search string) to the variable pool,
then you MACRO (see isrmbrs) can 'GET' the string and perform FINDs.
each find will provide you with the line number (isredit edit macro LINENUM)
and the isredit edit macro member will tell you the member name.
Thnx dbz for replying.But I want to do a srchfor operation in rexx for a string in members of a pds.It would be good if I am able to do so.This MACRO isnt that clear to me.I mean I wasnt able to comprehend this macro and your idea of putting and getting that well.
then invoke superc with your rexx scripts after allocating the files necessary,
then parse the ouptut.
and yes, it will probably take more that 12 minutes to understand the concepts of invoking a pds member in VIEW with an initial edit macro.
the only advantage to learning this is then you could use it when you wanted to make global changes to a PDS and the other utilities are not built for the task.
i.e. replacing one or more lines with more than one line.
sorry about the get and put, should have been VGET and VPUT which are explained here.
short of actually exerting any effort on your part,
you could submit (or interactive) a search, using the parm IDPFX, which will print the member name on the left side of each hit displayed.
ISRSUPC - MVS/PDF FILE/L
MEMBER LINE-# SOURCE LINE
that way you have all the info you need in the superc output. _________________ Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
I hope the following way wil give solution ( if i untersatnd correctly)
1. Provide PDS name and Search string
2. Using ListDS command get all the members under that PDS.
3. Read each meber data using EXECIO read operation.
4. search for the word in the line.
5. If finds , write the line content and the PDS member name in a PS file.
Hope this is useful... _________________ Gaining Knowledge
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum