Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

List the members in PDS using LMMLIST services

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: List the members in PDS using LMMLIST services
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

Moderator


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

PostPosted: Mon Dec 02, 2013 6:12 pm    Post subject:
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    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Mon Dec 02, 2013 6:58 pm    Post subject:
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: 1715
Location: UK

PostPosted: Mon Dec 02, 2013 6:58 pm    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Mon Dec 02, 2013 7:10 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts reorder screeNS using SWAP LIST? mrsidhu12 TSO/ISPF 5 Thu Sep 01, 2016 2:19 pm
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us