Doubt in REXX



IBM's Command List programming language & Restructured Extended Executor

Doubt in REXX

Postby apentyala » Wed Nov 23, 2011 5:48 pm

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.
apentyala
 
Posts: 2
Joined: Wed Nov 23, 2011 5:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt in REXX

Postby Akatsukami » Wed Nov 23, 2011 7:33 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Doubt in REXX

Postby NicC » Wed Nov 23, 2011 8:14 pm

Why? Srchfor gives you the ability to write your results to a dataset.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Doubt in REXX

Postby apentyala » Thu Nov 24, 2011 2:27 pm

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.
apentyala
 
Posts: 2
Joined: Wed Nov 23, 2011 5:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt in REXX

Postby NicC » Thu Nov 24, 2011 5:43 pm

srchfor is an option in ISPF 3 - Utilities. I think 3.14 & 15
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Doubt in REXX

Postby NicC » Thu Nov 24, 2011 10:38 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Doubt in REXX

Postby halfteck » Fri Nov 25, 2011 2:15 pm

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.
halfteck
 
Posts: 42
Joined: Tue Nov 08, 2011 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Doubt in REXX

Postby NicC » Fri Nov 25, 2011 10:08 pm

To be honest - I didn't either until I tried it as per TS's post.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Doubt in REXX

Postby Pedro » Tue Nov 29, 2011 6:51 am

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).
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Doubt in REXX

Postby dick scherrer » Tue Nov 29, 2011 12:51 pm

One of the advantages of proximity :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post