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:   Fri, 4 Jun 2004 14:11:42 -0700
Reply-To:   "Pardee, Roy" <pardee.r@GHC.ORG>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Pardee, Roy" <pardee.r@GHC.ORG>
Subject:   Re: what is wrong with this macro program?
Comments:   To: sportsfun <sportsfun77@HOTMAIL.COM>
Content-Type:   text/plain; charset="us-ascii"

Macro vars aren't resolved inside single quotes. You want to double-quote that filespec.

HTH,

-Roy

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of sportsfun Sent: Friday, June 04, 2004 1:58 PM To: SAS-L@LISTSERV.UGA.EDU Subject: what is wrong with this macro program?

The log of the program is the following and the files I try to input is like quar_1984.csv.

%macro quar; 125 %do i=1984 %to 1987; 126 127 DATA QUARTER; 128 INFILE 'D:\quarterly data\quar_&i.csv' DLM=',' DSD MISSOVER FIRSTOBS=2; 129 INPUT DATA21 DATA37 DATA38 DATA39 DATA44 DATA46 DATA48 DATA60 DATA69 DATA103 DATA104 129! DATA105 DATA107 GVKEY YEARA QTR; 130 ROA=DATA69/DATA44; 131 run; 132 133 %end; 134 %mend; 135 %quar;

ERROR: Physical file does not exist, D:\quarterly data\quar_&i.csv. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.QUARTER may be incomplete. When this step was stopped there were 0 observations and 17 variables. WARNING: Data set WORK.QUARTER was not replaced because this step was stopped. NOTE: DATA statement used: real time 0.01 seconds cpu time 0.01 seconds

ERROR: Physical file does not exist, D:\quarterly data\quar_&i.csv. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.QUARTER may be incomplete. When this step was stopped there were 0 observations and 17 variables. WARNING: Data set WORK.QUARTER was not replaced because this step was stopped. NOTE: DATA statement used: real time 0.01 seconds cpu time 0.01 seconds

ERROR: Physical file does not exist, D:\quarterly data\quar_&i.csv. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.QUARTER may be incomplete. When this step was stopped there were 0 observations and 17 variables. WARNING: Data set WORK.QUARTER was not replaced because this step was stopped. NOTE: DATA statement used: real time 0.01 seconds cpu time 0.01 seconds

ERROR: Physical file does not exist, D:\quarterly data\quar_&i.csv. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.QUARTER may be incomplete. When this step was stopped there were 0 observations and 17 variables. WARNING: Data set WORK.QUARTER was not replaced because this step was stopped. NOTE: DATA statement used: real time 0.01 seconds cpu time 0.01 seconds

Thanks!


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