Date: Tue, 1 Jul 2008 13:28:17 -0500
Reply-To: Mary <email@example.com>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mary <mlhoward@AVALON.NET>
Subject: Proc SQL- use of "as" brings along the old label!
Content-Type: text/plain; charset="iso-8859-1"
I just ran across an unexpected result in Proc SQL; if I attempt to use the "as" to create a new name, then if there is a label attached to it, it retains the old label! Example:
informat old_name $20.;
input old_name $;
label old_name= 'old_name';
create table newtest as
select old_name as new_name
In this case the variable "newname" in newtest has the label "old_name". It might be something to watch out for, especially since ODS does assign labels to many of its variables automatically. At first in looking at the data I was thinking that it was not changing the name for me, but upon looking at the attributes, it was changing the name, but when I looked at the data set I was looking at the old label! Thus the "as" keyword in Proc SQL is behaving more like a rename than a computed new variable.