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 (February 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 18 Feb 2004 05:21:03 -0500
Reply-To:     Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject:      Re: Resolving Macro variable in Cards Stmt!

On Wed, 18 Feb 2004 00:01:35 -0800, Easwara Moorthy <easwar_ps@YAHOO.COM> wrote:

>Hi All... > I need to resolve a Macro variable in a Data step.How can i do that!? >I'll be Happy if i get a solution! > >Requirement >----------- > >%let a='Year'; >........ >........ >........ > >%macro eas; > Data one; > input empid; > datalines; >&a2004 >&a2003 >&a2002 >; >run; >%mend; > >%eas; > >expected result: >---------------- >Year2004 >Year2003 >Year2002 > >Thanks in Aadvance! > >Easwar!

Why u use a macro? Not necessary... 2. don't use the quotes for a macro variable. Try:

%let a=Year;

Data one; input empid:$10.; cards; 2004 2003 2002 ; run;

data one; set one; empid="&a"!!empid; run;


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