Date: Thu, 15 Jul 2004 03:00:38 -0700
Reply-To: Bazyllll <bazyllll@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Bazyllll <bazyllll@HOTMAIL.COM>
Organization: http://groups.google.com
Subject: sas question about macro
Content-Type: text/plain; charset=ISO-8859-1
Hi I'm a student in biology and need an ACP procedure for my work. I'm
calling a macro that seems not to compile with a DO because it seems
not to end.
What's wrong with it, can you help me please?
I think it's a simple syntax problem but i'm not familiar with macro.
Hope you'll can help me. Thanks in advance.
Bazyllll
%macro CONTRIB(tab,p);
proc means data=&tab noprint vardef=n;
var AXE1-AXE&p;
output out=LAMBDA var=LAMBDA1-LAMBDA&p n=N;
data LAMBDA;
set LAMBDA;
Code=1;
data CONTRIB;
set &tab;
Code=1;
data CONTRIB;
merge CONTRIB LAMBDA;
by Code;
data CONTRIB;
set CONTRIB;
%do i=1 %to &p; Carre&i=Axe&i*Axe&i; end;
Norme2 = %do i=1 %to &p; +Carre&i %end;
%do i=1 %to &p; Cont_&i=Carre&i/Lambda&i/N; %end;
%do i=1 %to &p; Cos2_&i=Carre&i/Norme2; %end;
keep Nssd Norme2 Cont_1-Cont_&p Cos2_1-Cos2_&p;
run;
title2 'Contributions relatives des sites a l inertie des axes';
proc print data=CONTRIB;
var Nssd Cont_1-Cont_41 Norme2;
sum CONT_1-CONT_41 Norme2;
run;
title2 'Qualite de la representation des sites (cosinus carres)';
data CONTRIB;
set CONTRIB;
COS2_12=COS2_1+COS2_2;
COS2_123=COS2_12+COS2_3;
proc print data=CONTRIB;
var Nssd COS2_1 COS2_2 COS2_12 COS2_3 COS2_123;
run;
%mend CONTRIB;