Date: Thu, 23 Nov 2006 11:05:03 -0800
Reply-To: RolandRB <rolandberry@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: RolandRB <rolandberry@HOTMAIL.COM>
Organization: http://groups.google.com
Subject: Re: A question about how to let user defined macro returns
In-Reply-To: <200611231610.kANBsYPx002299@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
Gerhard Hellriegel wrote:
> example:
>
> %macro double(x);
> %let res=%eval(&x*2);
> &res;
I think that last semicolon should not be there.
> %mend;
>
> %let test=%double(8);
>
>
> But be careful with the usage:
>
> data a;
> set sashelp.class;
> *double_age=%double(age); /* this will not work */
> quad_age=age*%double(2);
> put quad_age;
> run;
>
> Regards,
> Gerhard
>
>
> On Thu, 23 Nov 2006 09:47:17 -0500, Minze Su <slhappyls@GMAIL.COM> wrote:
>
> >Dear all:
> >
> > I think in SAS a macro can work as a functions, but how can it give back
> >value as other programming languages do.
> >
> >BR,
> >
> >Minze
|