Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Search for the 1st instance of a particular member

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Search for the 1st instance of a particular member
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

Moderator Team Head


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

PostPosted: Thu Jan 03, 2008 11:10 am    Post subject: Reply to: Search for the 1st instance of a particular member
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    Post subject:
Reply with quote

i checked the prev posts

http://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

Moderator Team Head


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

PostPosted: Thu Jan 03, 2008 11:38 am    Post subject: Reply to: Search for the 1st instance of a particular member
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:

http://ibmmainframes.com/viewtopic.php?t=27026
http://ibmmainframes.com/viewtopic.php?t=26176
http://ibmmainframes.com/viewtopic.php?t=25947
http://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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Jan 04, 2008 2:06 am    Post subject: Reply to: Search for the 1st instance of a particular member
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    Post subject: Reply to: Search for the 1st instance of a particular member
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    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
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us