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 (October 2006, 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 Oct 2006 17:39:58 -0400
Reply-To:   Scott Czepiel <sczepiel@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Scott Czepiel <sczepiel@GMAIL.COM>
Subject:   Re: A question about %do %to statment in macro
In-Reply-To:   <4636145f0610021426y142c3c4eybcc517759fdb2b5f@mail.gmail.com>
Content-Type:   text/plain; charset=ISO-8859-1; format=flowed

On 10/2/06, minze su <slhappyls@gmail.com> wrote: > > I would say sas is not good >

Before condemning SAS as not good, understand that this is the macro environment we are talking about here. Macros are primarily meant for text substitution, and the control structures available in that environment are not meant to be a complete numerical programming environment. The macro facility is designed to offer flexible ways of turning a lanuage of symbols into SAS statements. That's why you often hear of "macro expansion", because macros expand a small set of symbols into a larger set. The fact that you must use integral increments in the %do loop construct is due as Toby said to the fact that this statement involves an implicit call to %eval and not %sysevalf.

But there are still options to accomplish what you need to do.

Here are 3 options, there are certainly other ways too.

1) You can try the method Toby suggested which provides access to a sequence of arbitrary values. 2) Find a way to do this in a data step where "do i=0 to 1 by 0.1" is perfectly valid. 3) Find the least common denominator of all possible iterations you are interested in, set that to 1, and rescale accordingly.

Best of luck!


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