| Date: | Tue, 11 Nov 2008 13:10:49 -0600 |
| Reply-To: | Mary <mlhoward@avalon.net> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Mary <mlhoward@AVALON.NET> |
| Subject: | Re: how to label varibles |
|
| Content-Type: | text/plain; format=flowed; charset="iso-8859-1";
reply-type=original |
One approach is to "write code to write code"; I find this handy for many
situations:
data labels_set;
informat varname $50. label $50.;
infile cards delimiter=',' MISSOVER DSD;
input varname label;
cards;
isv_study_nbr,Study Nbr
isv_visit_location,Visit Location
isv_visitdate,Date of Visit
;
run;
filename ft35f001 "c:\temp\ft35f001.txt";
data codeset;
informat var1 $600.;
set labels_set;
var1= trim(varname) || '=' || trim(label);
file ft35f001;
put var1;
run;
data new;
set isv_injection_study_visits;
label
%inc ft35f001/source2;
;
run;
-Mary
----- Original Message -----
From: Jeff
To: SAS-L@LISTSERV.UGA.EDU
Sent: Tuesday, November 11, 2008 12:03 PM
Subject: how to lable varibles
I have table 1 contains:
name label
v1 my label 1
v2 your label
-------
I have table 2 contaion
id v1 v2 v3...
I want v1 v2 v3 to be labeled by using label in table 1, how can I do that?
(v1 will be label "my label 1", v1 to be labeled "your label"...)
Thanks.
Jeff
|