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 (April 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 27 Apr 2005 23:21:27 -0400
Reply-To:   Jianping Zhu <zhujp98@gmail.com>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jianping Zhu <zhujp98@GMAIL.COM>
Subject:   Re: Problem with Nested Macros
Comments:   To: sa polo <solouga2@rediffmail.com>
In-Reply-To:   <20050428030205.6172.qmail@webmail7.rediffmail.com>
Content-Type:   text/plain; charset=ISO-8859-1

sa, should be CALL EXECUTE( '%RunMe('||xx||')'); JP On 4/27/05, sa polo <solouga2@rediffmail.com> wrote: > Hello All; > I am unsuccessfully attempting to run a macro within a macro . > The macro %RunDates takes a year and month and passes all > WEEKDAYS to a second macro %RunMe which prints the string that is > passed to it. > > %MACRO RunMe(xx); > DATA _NULL_; > PUT xx=&xx; > RUN; > %MEND; > > %MACRO RunDates(YYMM); > data _null_; > FirstDay=TRIM(LEFT(PUT(&YYMM,z6.)))||TRIM(LEFT(PUT(01,z2.))); > FirstDaySAS=INPUT(FirstDay,YYMMDD10.); > PUT FirstDaySAS=date7.; > Last_Day_of_Month=INTNX('MONTH',FirstDaySAS,0,'END'); > PUT Last_Day_of_Month=date7.; > do i = FirstDaySAS to Last_Day_of_Month; > start=intnx('Day',FirstDaySAS,i)-FirstDaySAS; > if 2 <= weekday(start) <= 6 then do; > put start=date7.; > xx=PUT(start,YYMMDDN8.); > yy=COMPRESS('flags_fiveT1A_' ||xx ||'.csv'); > CALL EXECUTE( %RunMe(xx)); > end; > end; > run; > > %MEND; > > %RunDates(200503) > Any help is much appreciated. > > Sa >


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