View previous topic :: View next topic
|
Author |
Message |
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
Hi ofer71,
Thnx for the reply. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
|