Date: Mon, 14 May 2007 13:39:55 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: macro question.....maybe SYMPUT
In-Reply-To: <18406012.1179149670665.JavaMail.root@mswamui-bichon.atl.sa.earthlink.net>
Content-Type: text/plain; format=flowed
Peter ,
The fact that you have 900 variables should be enough room for concen to
stop ya and make you think. First normalize your data, then add the group
min and max values, then simply use a where or subsetting if or if you
decide to use SQL use the having clause to cull down your data.
Toby Dunn
On the other hand, you have different fingers. ~ LCG
The early bird may get the worm, but the second mouse gets the cheese in the
trap. ~ LCG
What happens if you get scared half to death, twice? ~ LCG
From: Peter Flom <peterflomconsulting@MINDSPRING.COM>
Reply-To: Peter Flom <peterflomconsulting@mindspring.com>
To: SAS-L@LISTSERV.UGA.EDU
Subject: macro question.....maybe SYMPUT
Date: Mon, 14 May 2007 09:34:30 -0400
Hello again
I am gradually trying to figure out some basic macros, working through Art
Carpenter's excellent book on the subject (I've got the first edition).
Unfortunately, what I have to do now is (at least for me) advanced....
I have a data set with 900 variables and about 1000 people. These people
can be grouped in various ways. Now, my boss would like to see a list of
cases, by group, where the standardized values are extreme, for each of the
900 variables. I've created the standardized variables using PROC STANDARD.
Now, if I wanted to do what she wants for ONE variable, it would be easy
proc print data = standardized;
var maf1d1 disc1 disc2 disc3 disc4;
where abs(maf1d1) > 2;
run;
but with 900 variables, I am not sure what to do.
On page 71 of Art's book there is a macro to plot things by region, which I
tried to adapt.....but....
here's my code
<<<<<
%macro outlie;
data _NULL_;
set standardized;
by lgroup;
if first.lgroup then
do;
i + 1;
III = left(put(i,3.));
call symput('grp'||III, lgroup);
call symput('total', III);
end;
run;
%do i = 1 %to &total;
proc print data = standardized;
var &&grp&i lgroup disc_use1-disc_use4;
where abs(&&grp&i) > 2;
run;
%end;
%mend outstand;
%outlie;
>>>>>
But I get errors....
variable A not found
variable N not found
I don't understand.....what are variable A and N?
TIA as always
Peter
_________________________________________________________________
Like the way Microsoft Office Outlook works? You’ll love Windows Live
Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_outlook_0507