Date: Fri, 22 Oct 2010 08:46:19 -0700
Reply-To: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject: RE: How to rename variable names containing invalid sas
characters ö and ä
Content-Type: text/plain; charset="iso-8859-1"
Well, the positional column reference in SAS SQL
may do the trick for you:
create table ClassVarsRenamed as
1 as var1,
2 as var2,
3 as var3,
4 as var4,
5 as var5
Hope this is helpful.
Investment Business Intelligence
Investment Management & Research
Global Leaders in Multi-Manager Investing
From: Tom Cohen [mailto:firstname.lastname@example.org]
Sent: Friday, October 22, 2010 1:23 AM
To: Terjeson, Mark
Subject: Re: How to rename variable names containing invalid sas characters ö and ä
I did check if these are labels using proc contents but no they are not.
Originally the dataset was an spss file but my client has saved the data as an sas datafile and sent it to me.
When I opened the sasdatafile I got these variables with invalid characters. Is there any way to get rid of these characters?
2010/10/21 Terjeson, Mark <Mterjeson@russell.com>
Just out of curiosity, those characters are
usually no allowed as valid variable name
characters. Could you be meaning the variable
One way to check is to go to your dataset
explorer navigation pane in SAS and rightclick
the dataset and select View Columns. The
variable name will be the "Column Name" column
and the label will be the "Label" column.
Hope this is helpful,
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Tom Cohen
Sent: Thursday, October 21, 2010 1:07 PM
Subject: How to rename variable names containing invalid sas characters ö and ä
I got a sas dataset with variable names containing scandinavian characters ö
('o' with to dots) and 'ä' ('a' with two dots).
I tried to rename these variables to sas valid variables as following
set data a;
rename sätt = satt;
but got an error message said sätt (containing 'a' with two dots) is
invalid sas name.
I would like to rename all variables with invalid characters automatically
if any variables containing either scandinavian 'ö' or 'ä' or 'ö and ä' then
substitute these characters to 'o' and 'a'.
Thanks alot for your help.