| Date: | Tue, 1 Jun 2004 15:20:44 -0500 |
| Reply-To: | Duck-Hye Yang <dyang@CHAPINHALL.ORG> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Duck-Hye Yang <dyang@CHAPINHALL.ORG> |
| Subject: | Another macro question |
|
| Content-Type: | text/plain; charset=US-ASCII |
Hi,
The following code worked perfect until I changed my input data (here1.xytrct). The variable FIPS has 11 digit number, and it was coded as string variable.
------------------------------------------------------
%macro doGetZips(fips=);
%local i zip;
%let i = 1;
%let zip = %scan(&zips., &i.);
%do %while(&zip.^=);
%put NOTE: i=&i. zip=&zip.;
%getzips(findzip="&zip.", out=z&zip.)
%let i = %eval(&i. + 1);
%let zip = %scan(&zips., &i.);
%end;
%mend doGetZips;
proc sql noprint ;
select FIPS into :zips separated by ' '
from here1.xytrct;
quit;
%doGetZips(fips=&zips.)
---------------------------------------
The error message was as follow:
---------------------------
ERROR: Overflow has occurred; evaluation is terminated.
ERROR: The condition in the %DO %WHILE loop, &zip.^=, yielded an invalid or missing
value, . The macro will stop executing.
ERROR: The macro DOGETZIPS will stop executing.
-----------------------------------------------------
I feel that I may need to change the macro above to accomodate 11-digt number string variable. But I do not know how to do so.
Thanks,
Duckhye
|