What is meant by "automatically" -- you have a list of and member names in your post -- is that not what is available to your SAS application? If not and you want to "automate" (using SAS programming logic and your own naming methodology) the member names, then you can use the DATA step to create the value using SAS IF THEN ; statements, as required.
Then with these values, you can generate the CHANGE statement parameters and output the information either to a SAS macro (mind the length limitation), or create a temporary sequential file and then use %INCLUDE (after a suitable FILENAME invocation for your file).
Apologies forr the confusion.I need to change all the members which are in oldname in a pds to a new name ..This is my exact requirement.
The oldname and the newname members are given in preivious post.