Date: Tue, 14 Aug 2001 07:57:56 -0700
Reply-To: "Huang, Ya" <ya.huang@AGOURON.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <ya.huang@AGOURON.COM>
Subject: Re: how can I replace variable names by label names?
Content-Type: multipart/alternative;
For a special case, ie. all the vars are numeric,
use proc transpose:
data xx;
x1=1; x2=2; x3=3; output;
x1=5; x2=7; x3=9; output;
label x1='lab_x1'
x2='lab_x2'
x3='lab_x3'
;
proc transpose out=yy;
var _all_;
data yy;
length _name_ $40;
set yy;
_name_=_label_;
proc transpose out=xx (drop=_name_);
option nocenter;
proc print;
run;
-----------------------
The SAS System 07:43 Tuesday, August 14, 2001 8
Obs lab_x1 lab_x2 lab_x3
1 1 2 3
2 5 7 9
If you have character vars, you still can
do transpose, but the vars in result data
will all be character.
Regards,
Ya Huang
> -----Original Message-----
> From: Eden Don [mailto:edendon@263.NET]
> Sent: Monday, August 13, 2001 4:58 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: how can I replace variable names by label names?
>
>
> Dear all,
>
> Could anybody show me the way to replace all variable names by label
> names in a data set? Any insights would be very much appreciated.
>
>
> Kind regards,
>
> Don
>
[text/html]
|