Date: Wed, 15 Jul 2009 15:09:59 -0400
Reply-To: msz03@albany.edu
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: Query around label
Content-Type: text/plain;charset=iso-8859-1
hi ... and you can use it as follows (part 2 of Joe's answer) ...
data temp;
x='1';
label x ='some label';
run;
data temp2;
set temp;
y=input(x,1.);
call symput('label_x',vlabel(x));
run;
proc datasets lib=work nolist;
modify temp2;
label y = "&label_x";
quit;
proc contents data=temp2;
ods select variables;
run;
Alphabetic List of Variables and Attributes
# Variable Type Len Label
1 x Char 1 some label
2 y Num 8 some label
--
Mike Zdeb
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
> The function vlabel() returns the label from a variable.
>
> -Joe
>
> On Wed, Jul 15, 2009 at 12:51 PM, Mathur, Rajat <
> Rajat.Mathur@diamondconsultants.com> wrote:
>
>> Hi
>>
>> Here is my problem around labels:
>>
>> data x.temp;
>> x='1';
>> label x ='some label';
>> run;
>>
>> data x.temp2;
>> set x.temp;
>> y=input(x,1.);
>> run;
>>
>> Now I need the same label for y as it is for x.
>>
>> Can anyone help me with this?
>>
>> Thanks in advance
>> -Rajat
>>
>> ________________________________
>> This transmission may (i) be subject to contractual, statutory or other
>> obligations of confidentiality; (ii) contain "protected health information "
>> as defined in HIPAA or "non-public personal information " as defined under
>> data privacy laws; or (iii) be otherwise strictly confidential. If you are
>> not the intended recipient of this message, you may not disclose, print,
>> copy or disseminate this information. If you have received this in error,
>> please reply to the sender only and delete the message. Unauthorized
>> interception of this e-mail is a violation of federal law. Diamond's
>> operating subsidiary in North America is Diamond Management & Technology
>> Consultants NA, Inc.; in the U.K. and Europe, Diamond Management &
>> Technology Consultants Limited; and in Asia, Diamond Management & Technology
>> Consultants Pvt. Ltd.
>>
>
|