BookmarkSubscribeRSS Feed
Sivanandam
Calcite | Level 5
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.
6 REPLIES 6
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
Sivanandam
Calcite | Level 5
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
Sivanandam
Calcite | Level 5
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
Sivanandam
Calcite | Level 5
Hi Scott,

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


Thanks,
Siva.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 886 views
  • 0 likes
  • 2 in conversation