Date: Thu, 8 Nov 2007 15:35:17 -0000
Reply-To: tanwan <tanwanzang@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: tanwan <tanwanzang@YAHOO.COM>
Subject: Re: feeding macro from a file
Content-Type: text/plain; charset="us-ascii"
Import into SAS that file that specifies the name of each csv file you
need to import into SAS. Let us call the resulting SAS file 'TOIMP'.
Assume TOIMP has 2 variables X, and Y, just as you used them in your
macro above, where X is source, and Y is destination. Then run the
following macro. Edit to suit. You may take a coffee break as it
works, (if the files are big and are in the hundreds)!
proc sql noprint;
select count(*) into :limit from TOIMP;
select x into :x1 - :x&limit from TOIMP;
select y into :y1 - :y&limit from TOIMP;
%do loop = 1 %to &limit;
proc import datafile="E:\dados planb\Planb\Producao\&&x&loop...csv"