Date: Fri, 3 Sep 2004 13:55:15 -0500 "Dunn, Toby" "SAS(r) Discussion" "Dunn, Toby" Re: Macro Question To: "Treder, David" text/plain; charset="us-ascii"

David,

Did you solve your problem, if so please share the solution, you have gotten our curiosity up.

Toby Dunn

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Treder, David Sent: Friday, September 03, 2004 1:53 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Macro Question

The assistance provided on this site is really quite amazing - thanks to you all who provided such thorough/informative responses to my question.

Dave

===================

Date: Thu, 2 Sep 2004 14:18:10 -0400 Reply-To: "Treder, David" <dtreder@GENESEEISD.ORG> Sender: "SAS(r) Discussion" From: "Treder, David" <dtreder@GENESEEISD.ORG> Subject: Macro Question Content-Type: text/plain; charset="us-ascii"

In the code, below, I'm trying to create 50 data "subsets" of the dataset a1 (and have them numbered data1-data50), where the mean of each of the subsets is less than 170 . It seems like I'm close -- everything works fine, but the proc datasets is "activated" every time, not only when the mean (of ss) is less than 170.

Any suggestions would be GREATLY appreciated.

Dave

--------------------------------------------------------

%let k1 = 0;

%let q1 = 0;

%macro q;

%do %until(&k1 > 50);

%let q1 = %eval(&q1 + 1);

data a2; set a1;

i = ranuni(0);

proc sort data=a2; by i;

data b&q1; set a2 (obs=25);

proc means noprint data=b&q1;

var ss; output out=t3 mean=;

data t4; set t3;

%if (ss < 170) %then %do;

%let k1 = %eval(&k1 + 1);

proc datasets nowarn;

change b&q1 = data&k1;

run; quit;

%end;

%end;

%mend;

%q;

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