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 (December 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 22 Dec 2004 14:27:00 -0500
Reply-To:     Ya Huang <ya.huang@AMYLIN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ya Huang <ya.huang@AMYLIN.COM>
Subject:      Change the label on fly, any better way?

Hi There,

The follwing code change the variable a's label based on its value. I wonder if there is a better way to do it. I've got a feeling, the two data step in the macro can be combined. I tried to use %sysfunc and symget, but failed.

Thanks

Ya --------------

data xx; a='breakfast'; delta=23; output; a='lunch'; delta=56; output; run;

%macro doit(a=);

data _null_; set xx; if a="&a"; call symput('alb',a); run;

data yy; set xx; if a="&a"; label a="&alb"; run;

proc print label; run;

%mend;

%doit(a=breakfast); %doit(a=lunch);


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