REXX to extract member names in PDS

REXX to get the membernames in PDS

The following Rexx code can be used to extract member names inside a PDS. This may prove very useful if you want to perform a repeated action on all the members of a PDS, just for example you may want to replace a string with a new value in all the members, then this REXX code will help you to get the list of all members in a PDS and you can write other steps in the macro to perform the steps on these members.

 

/* REXX  PDS */                                 
THEPDS = "'USERID.ABC.XYZ'"                
X = OUTTRAP('ML.')                              
"LISTDS "THEPDS" MEMBERS"                       
X = OUTTRAP('OFF')                              
DO N = 7 TO ML.0                                
  PARSE VAR ML.N MEMBER                         
  MEMBER=STRIP(MEMBER)                          
SAY "MEMBER NAME IS ==>" MEMBER                 
END                                             
EXIT 0                                         

Comments

Ima not sure but i tried this code it is not getting results it is giving error and iam not able to exit also

can u please let me know the exact code

use below command:
type "SAVE LIST" command line

go to 3.4 option
and check the userid.list.member file will be generated that contains all the members names of ur pds

if ur satisfied call
08888845628

Could you pls provide snapshots of the error messages that you are getting?

Hope you have given the correct PDS name.

/* REXX  PDS */                                 
THEPDS = "'USERID.ABC.XYZ'"                
X = OUTTRAP('ML.')                              
"LISTDS '"THEPDS"' MEMBERS"                       
X = OUTTRAP('OFF')                              
DO N = 7 TO ML.0                                
  PARSE VAR ML.N MEMBER                         
  MEMBER=STRIP(MEMBER)                          
SAY "MEMBER NAME IS ==>" MEMBER                 
END                                             
EXIT 0  

Hi,

 

I want to extract the dependencies from OPC scheduler using rexx tool,

Could you please help in the code ?

hi ,

the code works fine and displays the result immediately. I want to write the result in a file. how to do it.

I have tried the below code

/* REXX PDS */
THEPDS = "'USERID.ABC.XYZ'"
X = OUTTRAP('ML.')
"LISTDS "THEPDS" MEMBERS"
X = OUTTRAP('OFF')
DO N = 7 TO ML.0
PARSE VAR ML.N MEMBER
MEMBER=STRIP(MEMBER)
SAY "MEMBER NAME IS ==>" MEMBER
END
EXIT 0

But am getting the RC(-3) saying that bad arithmetic expression in line number 7.

Please help to resolve this issue.