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

Search for the 1st instance of a particular member


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
biswadeepghosh

New User


Joined: 03 Jan 2008
Posts: 14
Location: Pune

PostPosted: Thu Jan 03, 2008 10:58 am
Reply with quote

I need to write a REXX pgm to scan thru a list of libraries in a particular order (may be saved in a sequential file) and search for the 1st instance of a particular member in those libraries.

Any related sample code would be helpful.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Jan 03, 2008 11:10 am
Reply with quote

A. Why wouldn't you just search for a member from within the DSLIST (ISPF option 3.4) if possible?

B. If, for some reason, that wouldn't work, then the logic is relatively easy:

1. Read the name of the library from the file.
2. Create the member list of that library.
3. See if the desired member name exists.
4. If yes, exit or, if no, continue on as necessary.

C. There are many, many topics already posted in this forum for the same basic process. Find one that works for your situation.
Back to top
View user's profile Send private message
biswadeepghosh

New User


Joined: 03 Jan 2008
Posts: 14
Location: Pune

PostPosted: Thu Jan 03, 2008 11:29 am
Reply with quote

i checked the prev posts

ibmmainframes.com/about13908.html

but it was of no help ..... Can you please suggest

A. I'm developing a ISPF screen which requires this functionality

B. do you have any sample REXX code .. or can you tell me the command for creating a member list of a library.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Jan 03, 2008 11:38 am
Reply with quote

That topic you referred to DOES have the code samples you need. However, if you're going to be using ISPF anyway, why not use the LMMLIST Library Management service? There are plenty of previous topics on using it also:

ibmmainframes.com/viewtopic.php?t=27026
ibmmainframes.com/viewtopic.php?t=26176
ibmmainframes.com/viewtopic.php?t=25947
ibmmainframes.com/viewtopic.php?t=5501
Back to top
View user's profile Send private message
Ganesh.Deokar

New User


Joined: 30 Sep 2005
Posts: 26
Location: Buffalo,NY

PostPosted: Fri Jan 04, 2008 1:52 am
Reply with quote

biswadeepghosh

Try this:
You said you have a list od PDS stored in a PS file, say XXXX.PDS.LIST
Now the rexx code is simple:
Code:
/*rexx*/                                                     
address tso                                                 
say 'Enter Member Name:'                                     
pull member                                                 
"alloc da('XXXX.PDS.LIST') fi(list) shr reuse" 
"execio *  diskr list (stem read. finis"                     
found = 'n'                                                 
do i = 1 to read.0 by 1 until found = 'y'                   
   pds = word(read.i,1)                                     
   pdsmem = pds||'('||member||')'                           
   if sysdsn(''''pdsmem'''') = 'OK' then do                 
      found = 'y'                                           
      say pds                                               
   end                                                       
end                                                         
if found = 'n' then say 'Member not found'                   
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri Jan 04, 2008 2:06 am
Reply with quote

Good point. I hadn't thought of just using the SYSDSN command, since the O/P only wants to check for the existence of a member, not actually do anything with it.
Back to top
View user's profile Send private message
biswadeepghosh

New User


Joined: 03 Jan 2008
Posts: 14
Location: Pune

PostPosted: Fri Jan 04, 2008 9:52 am
Reply with quote

Thanks guys ....

I used LISTDS to get the reqd output ...

[/img]
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 Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top