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

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


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Tue Jan 09, 2007 2:04 am
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
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: 2358
Location: Israel

PostPosted: Tue Jan 09, 2007 2:39 am
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
Reply with quote

Hi ofer71,

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

Global Moderator


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

PostPosted: Tue Jan 09, 2007 3:02 am
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 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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Running REXX through JOB CLIST & REXX 13
Search our Forums:

Back to Top