Date: Thu, 21 Oct 2010 15:15:29 -0500
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: How to rename variable names containing invalid
sas characters ö and ä
In-Reply-To: <AANLkTi=mGq=UwGBBs=SmSvWg+Z3jygOSX1tT8ir+ShL0@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Tom,
I would look at A. What are the variables actually named? The odds are
they are LABELED with the characters, and named either with the english
equivalent, or with _ instead of the offending characters. Take a look and
see! PROC CONTENTS, or just open the dataset and switch to viewing Names
instead of Labels.
-Joe
On Thu, Oct 21, 2010 at 3:06 PM, Tom Cohen <cohen.tom78@gmail.com> wrote:
> Dear List,
>
> 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
>
> data b;
> set data a;
> rename sätt = satt;
> run;
>
> 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
> something like
> if any variables containing either scandinavian 'ö' or 'ä' or 'ö and ä'
> then
> substitute these characters to 'o' and 'a'.
>
> Thanks alot for your help.
> Best regards,
> Tom
>
|