View previous topic :: View next topic
|
Author |
Message |
biswadeepghosh
New User
Joined: 03 Jan 2008 Posts: 14 Location: Pune
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
biswadeepghosh
New User
Joined: 03 Jan 2008 Posts: 14 Location: Pune
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Ganesh.Deokar
New User
Joined: 30 Sep 2005 Posts: 26 Location: Buffalo,NY
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
biswadeepghosh
New User
Joined: 03 Jan 2008 Posts: 14 Location: Pune
|
|
|
|
Thanks guys ....
I used LISTDS to get the reqd output ...
[/img] |
|
Back to top |
|
|
|