Page 1 of 1

How to list members of a PDS in REXX

PostPosted: Wed Jun 18, 2008 2:56 pm
by fazillatheef
Hi
Is there a function in REXX to get the names of the members in a PDS?
Thanks in advance.

Re: How to list members of a PDS in REXX

PostPosted: Wed Jun 18, 2008 7:00 pm
by MrSpock
No, there isn't. However, see this previous topic for some suggestions.

Re: How to list members of a PDS in REXX

PostPosted: Thu Jun 19, 2008 6:22 am
by Chaitnya
fazillatheef wrote:Is there a function in REXX to get the names of the members in a PDS?


No there is no direct function in rexx but you may try this logic. It's working correctly for me and will get member name on the screen one by one as there is say statement, The member name is stored in the STEM MEMS. :ugeek:

/*REXX*/                                       
INPUT  = ' YOUR PDS NAME '                   
            X = OUTTRAP(MEMS.)                 
 /* TO GET THE MEMBER LIST FROM THE INPUT PDS */
            "LISTDS '"INPUT"' MEM"             
            X = OUTTRAP(OFF)                   
DO I=7 TO MEMS.0                               
      MEMS.I = STRIP(MEMS.I)                   
       SAY 'MEMBER:'MEMS.I                     
END                                           
EXIT