Help using Base SAS procedures

To rename the PDS members

Reply
Contributor
Posts: 38

To rename the PDS members

I have list of PDS members(old named) as below

Oldname Newname
2005 2344
3453 4353
5336 6788

I need to replace all the oldname members into a new name which is mentioned above .how i can achieve it?

using change statement i can do it for each member one by one manually.

But i need to make automatically change all the old names in to corresponding new name .
Couold you please help me to resolve this.
Super Contributor
Super Contributor
Posts: 3,174

Re: To rename the PDS members

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).

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 38

Re: To rename the PDS members

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.
Super Contributor
Super Contributor
Posts: 3,174

Re: To rename the PDS members

Okay - so it's a similar situation as your other post / thread at this link:

http://support.sas.com/forums/thread.jspa?threadID=14667

Use a SAS DATA step to generate your "PROC PDS" procedure CHANGE statement parameters out to a FILENAME-allocated temporary file, and then %INCLUDE the "fileref".

Note, the PROC PDS would execute after you execute the PROC PDSCOPY, since PDSCOPY does not support a similar CHANGE statement.

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 38

Re: To rename the PDS members

Hi Scott,
I tried the below code but am getting the following error
63 change %include zz=%include ss;
ERROR: Incorrect %INCLUDE statement will not be executed. There is a syntax

ERROR 22-322: Expecting a name.

ERROR 76-322: Syntax error, statement will be ignored.

Code:

filename yy'xo94.control.user' disp=old;
filename zz'xo94.output.process1';
filename ss'xo94.output.process2';
data siva;
proc pds ddname=yy;
change %include zz=%include ss;
;
run;

Thank,
Siva.
Super Contributor
Super Contributor
Posts: 3,174

Re: To rename the PDS members

Your INCLUDE file needs to provide all CHANGE statement parameters as shown in the prior thread - repeated here:

CHANGE
%INCLUDE ;
;

Your input file must have syntactically valid CHANGE statement parameters for the members you wish to rename, supplying (to be generated by your DATA step logic):

=
=
=

So, you will have two files, one for the PROC PDSCOPY if you need a SELECT statement to copy a subset list of PDS members. And then another input file which contains the CHANGE statement parameters.

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 38

Re: To rename the PDS members

Hi Scott,

Thanks very much for you valuable suggestions.its working fine.


Thanks,
Siva.
Ask a Question
Discussion stats
  • 6 replies
  • 157 views
  • 0 likes
  • 2 in conversation