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 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 18 Dec 2006 15:07:55 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: Macro variable not resolved
Comments: To: scolas@datametric.fr
In-Reply-To:  <1166453761.4586ac015dd05@ssl0.ovh.net>
Content-Type: text/plain; format=flowed

Data Fin_NumDisp ( Drop = I J ) ; Set B.Fin_NumDisp ; Array Gat32_ ( 7 ) ; Array Pow32_ ( 5 ) ;

Do I = 1 To 7 ;

Gat32_( I ) = Gat32_( I ) * ( BNDN1 + BNDP1 ) ;

End ;

Do J = 1 To 5 ;

Pow32_( I ) = Pow32_( I ) * ( BNDN4 + BNDP4 ) ;

End ;

Run ;

So easy to mod I didnt have to put down my Jalopeno and cheese sausage kolache.

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: Stéphane COLAS <scolas@datametric.fr> To: toby dunn <tobydunn@HOTMAIL.COM> CC: SAS-L@LISTSERV.UGA.EDU Subject: Re: Macro variable not resolved Date: Mon, 18 Dec 2006 15:56:01 +0100

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 >

_________________________________________________________________ WIN up to $10,000 in cash or prizes – enter the Microsoft Office Live Sweepstakes http://clk.atdmt.com/MRT/go/aub0050001581mrt/direct/01/


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