An Idea Exchange for SAS software and services

Comments
by Super User
on ‎10-06-2017 10:03 AM

Definitely overdue.  I might add the ability to use variable lists in nonstandard ways, along these lines:

 

rename in_1_dat - in_99_dat = in_1_sasdate - in_99_sasdate;

 

I'm not expecting it to be easy, but it would be useful.

by Super User
‎10-06-2017 10:13 AM - edited ‎10-06-2017 10:18 AM

There might be some confusion with the RENAME() function, but the = required by the RENAME statement should make it possible to tell the difference. 

A bigger problem might come if a data step had defined an array named RENAME.

For example you can currently write code like this to replace the value of the first variable in the array with the value of the second variable in the array. 

array rename (5);
old=1;
new=2;
rename (old)=(new) ;

When the number of parameters (tokens) is unsuitable for an assignment to an array reference then it should be clear it is a RENAME statement.

Otherwise assume they meant the array reference.  The same way that it does when you make an array named N or MEAN or any other SAS function.

 

by Respected Advisor
a month ago

How about prefix replacement:

 

rename old: = new_: ; /* Change prefix */
rename _: = : ; /* Remove prefix */
by Super User
a month ago - last edited a month ago

Prefixes would be difficult given the way they currently work.  They find existing names that start with those letters, but for rename you generally need names that do NOT exist.  Maybe a syntax like this instead:

rename OLD =: NEW ;

that uses the : as a modifier to the = in a similar way that it is used with = and other comparison operators.

Idea Statuses
Top Liked Authors