Date: Tue, 31 Jul 2001 14:23:55 -0400
Reply-To: "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject: Re: Strange Macro Problem
Content-Type: text/plain; charset="ISO-8859-1"
> From: Ivis, Frank [mailto:frank.ivis@ICES.ON.CA]
> Can anyone explain what is going on with the code below? I just have a
> simple data step with an input statement, but it does not
> work within a macro! I have tested this with 8.0 Windows and 8.2 UNIX.
aiiiiiiyi!
The oldest macro mistake in the book:
trying to read cards within a macro.
read the error message!
at least now they tell you that your foot will bleed,
-before you pull the trigger! LOL
BTDT!
move your data step outside the macro
or else put the data in a file.
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
OpSys: Win_Pro Ver: 8.2
---> cheerful provider of UNTESTED SAS code!*! <---
remember perspective: the error is not always where it seems to occur! --
RJF2
> 90 options mprint;
> 91 %macro junk;
> 92 data test;
> 93 input x y;
> 94 cards;
> 95 1 2
> 96 3 4
> 97 ;
> 98 run;
> 99
> 100 %mend junk;
> 101 %junk
> MPRINT(JUNK): data test;
> MPRINT(JUNK): input x y;
> MPRINT(JUNK): cards;
>
> ERROR: The macro JUNK generated CARDS (data lines) for the
> DATA step, which could cause
> incorrect results. The DATA step and the macro will
> stop executing.