Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Rexx code to find a string record in all members of dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Jan 09, 2007 12:42 am    Post subject: Rexx code to find a string record in all members of dataset
Reply with quote

I have the following REXX code requirement. Read a record(which contains a string of length 8). Find it in all the members of a PDS and write the output in a sequential file.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Jan 09, 2007 2:04 am    Post subject: Re: Rexx code to find a string record in all members of data
Reply with quote

First of all, why are you writing a function that already exists (see ISPF Option 3.14 (Search-For) or 3.15 (Search-For Extended, among others)?

Second, you failed to mention what exactly it is you want to write to the output file?

Third, everything you're doing here has already been posted within this Forum. Search and you'll find your answers.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Jan 09, 2007 2:15 am    Post subject:
Reply with quote

I couldn't find the exact code for my requirement.
I want to do it with REXX because
1.If I do it with 3.14 it takes a lot of time.As I have a file containning about 200 entries.Each entry needs to be found in all the members of the PDS.This means I have to search using 3.14 200 times.

I want the logic for the following to be precise ----
1.Read a string (each of the 200 records of sequential file contains 1 8 byte string) from a sequential file,find its presence in all the members of a PDS.
2.Write only the names of members in which the string was found.

I hope my requirement would be clear by now.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 09, 2007 2:39 am    Post subject:
Reply with quote

Just for you to know, SUPERC will always be faster then pure REXX instructions when it comes to comparison/search.

However, you can invoke SUPERC from within REXX. Using this method, you can supply different search string every time, and you can format the output for your needs.

O.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Jan 09, 2007 2:59 am    Post subject:
Reply with quote

Hi ofer71,

Thnx for the reply.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Jan 09, 2007 3:02 am    Post subject: Re: Rexx code to find a string record in all members of data
Reply with quote

That's exactly what my answer was going to be.

Pseudo code:

1. Read the search string from the PS dataset.
2. Create the ISRSUPC search parameter.
3. Run ISRSUPC.
4. Locate all the records with the text:
"member_name --------- STRING(S) FOUND -------------------"
and get the member name from the front.
5. Write the member name(s) to the output.
6. Go back to 1 until EOF.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us