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 (September 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 12 Sep 2005 12:35:55 -0700
Reply-To:     David L Cassell <davidlcassell@MSN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         David L Cassell <davidlcassell@MSN.COM>
Subject:      Re: running macro in SAS 9.0
In-Reply-To:  <200509121910.j8CIBK3M005133@malibu.cc.uga.edu>
Content-Type: text/plain; format=flowed

mayukh.dass@gmail.com wrote: >I am trying to run the following macro in SAS 9.1.3 > >%macro john(a=3D); >data temp; >set test1; >%if lot eq &a %then %do; >id+1; >%end; >run; > >data test1; >set temp; >run; >%mend john; > >%macro john1; >data two; >%do i=3D1 %to 145; >%john(a=3D&i); >%end; >run; >%mend john1; > >%john1; >quit; > > >The output is coming as: >258 %macro john(a=3D); >259 data temp; >260 set test1; >261 %if lot eq &a %then %do; >262 id+1; >263 %end; >264 run; >265 >266 data test1; >267 set temp; >268 run; >269 %mend john; >270 >271 %macro john1; >272 data two; >273 %do i=3D1 %to 145; >274 %john(a=3D&i); >275 %end; >276 run; >277 %mend john1; >278 >279 %john1; >280 quit; > >And its not doing anything its suppose to do.

Perhaps if you wrote back to SAS-L and explained what you're actually trying to do, someone on the list could help you. As it is, I'm just not sure what you want to do with your data. It looks like you're trying to call a data step. 145 times. Inside another data step, which is - as you know - illegal.

What did your log say, and what macro options were you using so that you could see the flow of your macro logic?

Have you tried to write this problem out with no macro code whatsoever? If so, what problems did you run into?

>Any suggestions will be appreciated.

Having just read my suggestions, you'd probably like to retract that. :-) :-)

David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330

_________________________________________________________________ Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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