Page 1 of 1

Doubt in REXX

PostPosted: Wed Nov 23, 2011 5:48 pm
by apentyala
Hi,
I have a requirement in REXX.
i need to find a string in a list of PDS (ex: A.B.C.D,A.B.C.E etc) using command SRCHFOR and i need
to capture all those PDS wherever the string is found.Do we have any way in REXX to capture
the datasets ? pls suggest.

Re: Doubt in REXX

PostPosted: Wed Nov 23, 2011 7:33 pm
by Akatsukami
apentyala wrote:Hi,
I have a requirement in REXX.
i need to find a string in a list of PDS (ex: A.B.C.D,A.B.C.E etc) using command SRCHFOR and i need
to capture all those PDS wherever the string is found.Do we have any way in REXX to capture
the datasets ? pls suggest.

Your query is vague and imprecise. Do you mean: "Can the DSNs be recorded?" If so, yes; put the DSN (and such other information as you deem necessary) into a variable, PUSH it onto the stack, and write it using EXECIO to a data set that has been allocated in the JCL or through the TSO ALLOCATE command.

Re: Doubt in REXX

PostPosted: Wed Nov 23, 2011 8:14 pm
by NicC
Why? Srchfor gives you the ability to write your results to a dataset.

Re: Doubt in REXX

PostPosted: Thu Nov 24, 2011 2:27 pm
by apentyala
Hi Nicc,
Thanks for your response.
Can you pls explain "'Srchfor gives you the ability to write your results to a dataset." in little more detail.
my requirement is to capture/record in my rexx program only the PDS wherever the string is found .

When i invoke SRCHFOR command as EDIT MACRO from my REXX program as below:

DSLIST - Data Sets Matching IN09829.B.C.*
Command ===> SRCHFOR CRMTRBXB

Command - Enter "/" to select action
---------------------------------------------
IN09829.B.C.D
IN09829.B.C.E
IN09829.B.C.G
IN09829.B.C.H
***************************** End of Data Set


DSLIST - Data Sets Matching IN09829.B.C.* String(s) found
Command ===>............................................... …........... Scroll ===> CSR

Command - Enter "/" to select action Message Volume
-------------------------------------------------------------------------------
IN09829.B.C.D............................String(s) found ….....B7D107
IN09829.B.C.E......................................................B7D057
IN09829.B.C.G............................String(s) found…......B7D107
IN09829.B.C.H......................................................B7D058
***************************** End of Data Set list ****************************

I should have a mechanism in my REXX program to store/capture only datasets IN09829.B.C.D,IN09829.B.C.G where the string is found.

Pls suggest me on this.

Re: Doubt in REXX

PostPosted: Thu Nov 24, 2011 5:43 pm
by NicC
srchfor is an option in ISPF 3 - Utilities. I think 3.14 & 15

Re: Doubt in REXX

PostPosted: Thu Nov 24, 2011 10:38 pm
by NicC
Have just played with SRCHFOR on the 3.4 dataset list screen - it put the results of the search in a dataset with the name hlq.SRCHDSL.LIST. I did not provide the name so I guess it is a default.

Re: Doubt in REXX

PostPosted: Fri Nov 25, 2011 2:15 pm
by halfteck
To all contributors on here. Just want to say a big thank you, i joined here only a few weeks ago and am delighted. Its true you are never too old to learn. I love searchfor on DSLIST, didnt know you could until today. I have been using ISPF for more years than i care to remember (sigh), but i guess i was complacent and didnt embrace new features / facilities, that will now change. Thanks again all, long may this forum last.

Re: Doubt in REXX

PostPosted: Fri Nov 25, 2011 10:08 pm
by NicC
To be honest - I didn't either until I tried it as per TS's post.

Re: Doubt in REXX

PostPosted: Tue Nov 29, 2011 6:51 am
by Pedro
I love searchfor on DSLIST, didnt know you could until today.


You are welcome! I am not the author, but I suggested it to the right people at IBM and it was implemented some time later.

It also now works on a concatenation of PDS's (now it tells you the actual DS name where the text was found).

Re: Doubt in REXX

PostPosted: Tue Nov 29, 2011 12:51 pm
by dick scherrer
One of the advantages of proximity :)

d