Date: Thu, 17 Jan 2008 08:17:49 -0800
Reply-To: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Subject: Re: Call Symput in %Do %While
In-Reply-To: <403593359CA56C4CAE1F8F4F00DCFE7D0C1E476D@MAILBE2.westat.com>
Content-Type: text/plain; charset="ISO-8859-1"
On Thu, 17 Jan 2008 08:11:49 -0500, "Ed Heaton" <EdHeaton@WESTAT.COM>
said:
> Hmmm... I'm not convinced of this extra iteration of the %do %while ()
> loop. Can you demonstrate this "feature"?
He may be thinking of DO UNTIL.
>
> Ed
>
> Edward Heaton, Senior Systems Analyst,
> Westat (An Employee-Owned Research Corporation),
> 1650 Research Boulevard, TB-286, Rockville, MD 20850-3195
> Voice: (301) 610-4818 Fax: (301) 294-2085
> mailto:EdHeaton@Westat.com http://www.Westat.com
>
>
>
>
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu]
> On Behalf Of jontugman@yahoo.co.uk
> Sent: Thursday, January 17, 2008 6:04 AM
> To: sas-l@uga.edu
> Subject: Re: Call Symput in %Do %While
>
>
> SAS always runs the loop once more when the condition has been met. It s
> just one of those things. Suggest second line of macro %if &balobs=4230
> %then %return; * and macro will stop.
>
> On Jan 15, 11:43 pm, Hjermstad <erikhjerms...@gmail.com> wrote:
> > I have a macro that needs to run while (or until) my value of balobs
> > is not equal to 4230. 4230 is the number of observations in a dataset
>
> > that the macro is creating. I use Call Symput at the end of the macro
>
> > to change the value of balobs. However, even when the value of balobs
>
> > equals 4230, the macro keeps going and going and going......MAKE IT
> > STOP!!!! :) Code is below, I trimmed down to only what I think one
> > of you geniuses needs to solve my problem. Thanks - erik
> >
> > Macro Start;
> >
> > %Do %while (balobs ne 4230);
> >
> > Data Score_Final;
> > set Score;
> > run;
> >
> > DATA _NULL_;
> > SET score_final nobs=xx;
> > CALL SYMPUT('balobs',PUT(xx,10.));
> > STOP;
> > run;
> >
> > %end;
> > Macro End;
--
Jack Hamilton
Sacramento, California
jfh@alumni.stanford.org
|