| Date: | Fri, 4 Jun 2004 17:10:21 -0400 |
| Reply-To: | Mark Biek <markb@STEVENSONCOMPANY.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Mark Biek <markb@STEVENSONCOMPANY.COM> |
| Subject: | Re: what is wrong with this macro program? |
|
| In-Reply-To: | <69d58c57.0406041258.21d787e@posting.google.com> |
| Content-Type: | text/plain; charset=us-ascii; format=flowed |
Your INFILE statements needs to use double-quotes. The single-quotes
are causing &i not be resolved.
sportsfun wrote:
> 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!
>
--
Mark Biek
The Stevenson Company
8700 Westport Rd. Ste. 200
Louisville, KY 40242-3100
(502) 429-9060 ext 251
|