| 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? |
|
| 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!
|