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

List the members in PDS using LMMLIST services


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rameyshkanthan v

New User


Joined: 15 Nov 2013
Posts: 10
Location: India

PostPosted: Mon Dec 02, 2013 4:19 pm
Reply with quote

Hi All,

I want to list the members of a PDS which are in particular pattern(like member* we use in 3.4 search ).

PDS name -> ramesh.pds.dt12
member -> MEMBERA, MEMBERB, MEMBERC

I tried using the ISPF function LMMLIST,but got RC4. If I give MEMBERA in pattern then i get RC0.

Code:

dsn = ramesh.pds.dt12                                 
memid = 'MEMBER?'         
                                     
/*****Begin main *******/                                       
 'ISPEXEC LMINIT  DATAID(dataid)                                 
                  DATASET('''dsn''')                             
                  ENQ(SHRW)'                                     
                                                                 
 'ISPEXEC LMOPEN  DATAID('dataid')'                             
                                                                 
do forever                                                       
 'ISPEXEC LMMLIST DATAID('dataid') OPTION(LIST) MEMBER('memlist')
                  STATS(NO) pattern('memid')'       
 if rc <> 0 then leave               
 say 'MEMBER LIST:' memlist           
end                                 
 
 'ISPEXEC LMCLOSE DATAID('dataid')'   
                                     
 'ISPEXEC LMFREE  DATAID('dataid')'       
       


Thanks in advance
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Dec 02, 2013 6:12 pm
Reply with quote

Change MEMBER? to MEMBER*
Back to top
View user's profile Send private message
rameyshkanthan v

New User


Joined: 15 Nov 2013
Posts: 10
Location: India

PostPosted: Mon Dec 02, 2013 6:43 pm
Reply with quote

Thank you, Its working now icon_smile.gif

Actually I want to scan a PDS and search member names with pattern MEMBER* ..
If only MEMBERA & MEMBERB are found in the PDS, then i need to return MEMBERC.

Same applies till MEMBERZ.

I thought LMMLIST will help me to do this, but now lost somewhere..

Can anybody give me an idea on this
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Dec 02, 2013 6:58 pm
Reply with quote

I have done this slightly different.
The pattern is done once outside of the loop. This creates the list.
The say statement is at the top of the loop.
Subsequent LMMLIST and rc check are at the bottom of the loop.

Code:
dsn = ramesh.pds.dt12                                 
memid = 'MEMBER*'         
                                     
/*****Begin main *******/                                       
 'ISPEXEC LMINIT  DATAID(dataid)                                 
                  DATASET('''dsn''')                             
                  ENQ(SHRW)'                                     
                                                                 
 'ISPEXEC LMOPEN  DATAID('dataid')'

 'ISPEXEC LMMLIST DATAID('dataid') OPTION(LIST) MEMBER('memlist')
                  STATS(NO) pattern('memid')'       
 if rc <> 0 then do
   Say 'No matches found'
   exit             
 end                           
                                                                 
do forever                                                       
 say 'MEMBER LIST:' memlist   
 'ISPEXEC LMMLIST DATAID('dataid') OPTION(LIST) MEMBER('memlist')
                  STATS(NO)'
         
 if rc <> 0 then leave               
           
end           
                     
 'ISPEXEC LMMLIST DATAID('dataid') OPTION(FREE)'
 
 'ISPEXEC LMCLOSE DATAID('dataid')'   
                                     
 'ISPEXEC LMFREE  DATAID('dataid')'     
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Dec 02, 2013 6:58 pm
Reply with quote

How do you expect to return MEMBERC if the only members are A & B?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Dec 02, 2013 7:10 pm
Reply with quote

After I read Nic's response.....

I mis-interpeted your question (silly me).

I thought you were not getting MEMBERC when it was actually there.

You want to know what the next MEMBER* will be?

Try this:

Code:
Alphabet = 'ABCDEFGHIJKLMOPQRSTUVWXYZ'
Last_letter = right(memlist,1)
t1 = pos(last_letter,Alphabet)
t1 = t1 + 1
new_letter = substr(Alphabet,t1,1)
new_member = 'MEMBER'||new_letter


If you have numbers, add them to your Alphabet.
Back to top
View user's profile Send private message
rameyshkanthan v

New User


Joined: 15 Nov 2013
Posts: 10
Location: India

PostPosted: Mon Dec 02, 2013 7:16 pm
Reply with quote

@daveporcelan - Thanks a lot, code works fine icon_smile.gif
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts How to access web services/website? Mainframe Interview Questions 4
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts list pds members name starting with xyz CLIST & REXX 11
Search our Forums:

Back to Top