Date: Mon, 18 Dec 2006 15:56:01 +0100
Reply-To: Stéphane COLAS <scolas@DATAMETRIC.FR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Stéphane COLAS <scolas@DATAMETRIC.FR>
Subject: Re: Macro variable not resolved
In-Reply-To: <BAY123-F18629E571F1B6D878C895EDEC90@phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1
Toby,
And what's happens if you have 12 Gat32 and 7 Pow32 ?
Stéphane.
Selon toby dunn <tobydunn@HOTMAIL.COM>:
> Priya ,
>
> This is one of those casses where a macro variable isnt needed at all,
> unless of course you have some other yet unstated yet very compelling reason
> to use macros.
>
> Data Fin_NumDisp ( Drop = I ) ;
> Set B.Fin_NumDisp ;
> Array Gat32_ ( 5 ) ;
> Array Pow32_ ( 5 ) ;
>
> Do I = 1 To 5 ;
>
> Gat32_( I ) = Gat32_( I ) * ( BNDN1 + BNDP1 ) ;
> Pow32_( I ) = Pow32_( I ) * ( BNDN4 + BNDP4 ) ;
>
> End ;
>
> Run ;
>
>
>
> Toby Dunn
>
> To sensible men, every day is a day of reckoning. ~John W. Gardner
>
> The important thing is this: To be able at any moment to sacrifice that
> which we are for what we could become. ~Charles DuBois
>
> Don't get your knickers in a knot. Nothing is solved and it just makes you
> walk funny. ~Kathryn Carpenter
>
>
>
>
>
>
> From: Priya <priyaworld2@YAHOO.COM>
> Reply-To: Priya <priyaworld2@YAHOO.COM>
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Macro variable not resolved
> Date: Mon, 18 Dec 2006 06:17:14 -0800
>
> Hi Every1,
>
> I am trying to write a code for doing
>
> Gat32_1 = Gat32_1 * (BNDN1 + BNDP1)
> Gat32_2 = Gat32_2 * (BNDN1 + BNDP1)
>
> Pow32_1 = Pow32_1 * (BNDN4 + BNDP4)
> Pow32_2 = Pow32_2 * (BNDN4 + BNDP4)
>
> etc ....
>
>
> But the following code gives me an error:
>
> %macro mac55;
>
> %let desc1= "Gat32";
> %let desc2= "Gat8pk";
> %let desc3= "Gat64";
> %let desc4= "Pow32";
> %let desc5= "TGAT";
>
> %let pid1 = 2;
> %let pid2 = 3;
> %let pid3 = 4;
> %let pid4 = 22;
> %let pid5 = 40;
>
> %let n1 = 11;
> %let n2 = 10;
> %let n3 = 6;
> %let n4 = 10;
> %let n5 = 15;
>
> data fin_numdisp;
> set b.fin_numdisp;
> %do i = 1 %to 5;
> %do j = 1 %to &&n&i;
> &&desc&i._&j = &&desc&i._&j * (BNDN&&pid&i + BNDP&&pid&i);
> %end;
> %end;
>
> run;
>
> %mend mac55;
>
> WARNING: Apparent symbolic reference DESC1_1 not resolved.
>
> ERROR : Statement is not valid or it is used out of proper order.
>
> Please suggest a way.
>
> _________________________________________________________________
> Stay up-to-date with your friends through the Windows Live Spaces friends
> list.
>
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mk
>
|