|
You can ignore error question this, I think. I tried the macro in a
different file by itself and got the same message. I started a new file
(no macros) and got the same message. So I restarted SAS, and no more
message. I haven't tried the macro, though.
I'm still curious - will this approach work?
Thanks,
Ben
> -----Original Message-----
> From: Witness [mailto:bmeyer67@calvin.edu]
> Sent: Wednesday, July 03, 2002 2:59 PM
> To: SAS-L
> Subject: Macro question & debug...
>
>
> I have the following code:
>
> %MACRO Daily(DayNumber=,InputTable=);
> PROC SORT DATA=&InputTable OUT="Day"||"&DayNumber";
> WHERE Day = &DayNumber;
> BY Hour;
> PROC SQL;
> CREATE TABLE "Day"||"&DayNumber"||"Hourly" AS
> SELECT
> Hour,Minute,Account,ID,Serial,COUNT(Day) AS Daily_Count,Day
> FROM "Day"||"&DayNumber"
> ORDER BY Hour;
> QUIT;
> %DO I = 0 %TO 24;
> /* will be calling another macro */
> %END;
> %MEND Daily;
>
> It's reporting that I am missing the %MEND, but I can't see
> where in I'm missing something that would cause this.
> (Exact message is: WARNING: Missing %MEND statement.)
>
> Also, before I get too deeply into this, will the table
> names resolve properly?
>
> I.e. will "Day"||"&DayNumber" resolve to Day1 when DayNumber
> = 1? Or does SAS not allow that type of thing?
> Considering how many tables I am going to be making, I
> want a quick way to do it.
>
> I'm essentially writing wrapper macros to do everything that
> I'm trying to do in this script.
> 1 Macro to handle each day, called in a loop 31 times.
> The day macro does the day stuff, and then in a loop calls a
> macro to handle the 24 hours of a day, 24 times.
> The hour macro does the hour stuff, and then in a loop calls
> a macro to break down each hour into 5 minute intervals, 12 times.
>
> is this possible to do? Will it work?
> Thoughts, suggestions, welcome.
>
> Thanks,
>
> Benjamen R. Meyer
>
> P.S. And no, I'm not looking for you to do my job, if that's
> what you may be wondering. I'm just wondering if I should
> continue to explore this path.
|