LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 1 Sep 2005 21:10:47 -0700
Reply-To:     shiling99@YAHOO.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         shiling99@YAHOO.COM
Organization: http://groups.google.com
Subject:      Re: assigning many variable labels?
Comments: To: sas-l@uga.edu
In-Reply-To:  <1125598695.996985.100270@g47g2000cwa.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"

Actually you ask SAS to a label generate statement for u. That is sas macro. As long as the request has logics that can be programminged, SAS macro can be a big help.

Here is an example.

HTH

data t1; retain a b c d e f; run;

* recode a b c want recode as a_new b_new c_new;

%macro label(n=3, varlist=a b c); %let new=; %do i=1 %to &n; %let new=&new %scan(&varlist,&i)_new="%scan(&varlist,&i) recode"; %end; label &new %mend;

data t2; set t1; a_new=a; d_new=d; e_new=e ; f_new=f; %label(n=4, varlist=a d e f) ; run;

proc contents; run;


Back to: Top of message | Previous page | Main SAS-L page