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 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments:   To: SAS-L@LISTSERV.VT.EDU
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


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