LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 1997, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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 &num; 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 &num; 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.


Back to: Top of message | Previous page | Main SAS-L page