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 1996, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 2 Sep 1996 02:24:14 GMT
Reply-To:     Clark Roberts <us026486@INTERRAMP.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Clark Roberts <us026486@INTERRAMP.COM>
Organization: Decision Analytics
Subject:      Re: Macro question

Stephen_Hiemstra@msn.com (Stephen Hiemstra) wrote:

>I would like to write a macro to call and increment another macro as follows: > >%MACRO CALLER( int_YY_FROM, int_YY_TO ); >%LOCAL k; > >%MACRO CALLEE( YY ); > >DATA ww.nabk&YY; > SET ww.nabk&YY; > **Do more stuff**; >RUN; > >%MEND CALLEE; > >%DO k = &int_YY_FROM %TO &int_YY_TO; CALLEE( %k ); %END; > >%MEND CALLER; > >%CALLER( 85, 95 ); > >This example failed for two reasons. First, my variables passed to >the %DO LOOP did not appears as integers to the loop, in spite of my >obvious passing of integers in the calling routine. Second, the >call to CALLEE failed because %k was not passed literally as %k and >not as a string. > >Can someone strengthen out the syntax here for me? I have been >getting lost in the MACRO guide on this one. > >Stephen

________________________

Without further information I'd say:

1. It looks like you have over complicated the problem. Why are you using the imbedded CALLEE macro, these statements could be executed directly in the %DO loop.

2. The names of the parameters for the CALLER macro are longer than 8 characters. This may be why you're getting the non integer error message? Just use FROM and TO.

3. I assume you're trying to pass the value of the %DO loop index variable to the CALLEE macro, it should be &k, not %k.

Clark Roberts Decision Analytics, A SAS(r) Quality Partner e-Mail dacmr@interramp.com or 76547.1575@compuserve.com Voice/FAX/Message: (619) 565-9998 Pager: (619) 975-0758


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