Date: Mon, 2 Jun 1997 20:29:29 -0400
Reply-To: chenxi@EASYWAY.NET
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Xi Chen <chenxi@EASYWAY.NET>
Subject: Re: FILE SPLITTING
Content-Type: text/plain; charset="us-ascii"
Steven,
The problem is that the previous assigned value for macro variable SELECT
will always be overwritten by the subsequent values before it has been used.
As the result, in each iteration, SELECT always takes the value of last
STATION.
%do i=1 %to #
data _null_;
set stations;
call symput('select',station);
data out1.temp&i;
set &basedata;
if station="&select";
run ;
%end;
A minor change should be:
%do i=1 %to #
data _null_;
set stations;
if _n_=&i. then call symput('select',station);
run;
data out1.temp&i;
set &basedata;
if station="&select";
run ;
%end;
I have not tested this program, but I think it is enough for you
to figure it out. Good Luck.
Chen Xi, Ph.D
PharmClint Co.
|