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 (April 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 26 Apr 2004 06:52:32 GMT
Reply-To:     "(2B) || !(2B) Arin Chaudhuri" <spam@SPAM.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "(2B) || !(2B) Arin Chaudhuri" <spam@SPAM.NET>
Organization: Road Runner - NC
Subject:      Re: error in a macro
Content-Type: text/plain; charset=us-ascii; format=flowed

Mayukh Dass wrote: > Hi, > WARNING: Apparent symbolic reference N not resolved. > NOTE: Line generated by the macro variable "N". > 1 &desc& > - > 22 The error is in this line : tothr=tothr+input(&&desc&n, 1.); n is a datastep variable not a macro variable.

You can wrap the whole thing in a macro. [warning! code untested] %macro m; data two; infile "C:\Documents and Settings\Mayukh Dass\My Documents\iFolder\6360\&filename" missover; input name$ (desc1-desc&vars_no)($); %do n=3 %to 16 %by 3; tothr=tothr+input(&&desc&n, 1.); %end; run; %mend; %m;

Or use an array instead of a macro i.e., array desc{*} desc1-desc&vars_no ...

and then you can write a do loop like,

do n=3 to 16 by 3; tothr=tothr+input(desc{n},1.); run;


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