Date: Sat, 28 Mar 2009 18:49:43 -0700
Reply-To: barry.brian.barrios@GMAIL.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: barry.brian.barrios@GMAIL.COM
Organization: http://groups.google.com
Subject: SQL selecting macro variables to be included in the table via a
do loop
Content-Type: text/plain; charset=ISO-8859-1
I was wondering if the fragment of code below is selecting the macro
variables which have been created from before via a do loop, is done
correctly? I am using the do loop again to call the macro variables
and putting them in the same table "Factors" via SQL. For some reason,
I don't think this is right what I am doing.
%do i=1 %to &counter;
%macro bygroupexport(portret,excess_port,fact);
PROC SQL;
CREATE TABLE Factors As
SELECT a.*, b.&portret, (b.&portret- a.RF) as &excess_port
From Factors as a, &fact as b
where a.date=MDY(b.month,1,b.year);
quit;
%mend bygroupexport;
%bygroupexport(portret&&byval&i,excess_port&&byval&i,&&byval&i);
%end;
|