Date: Tue, 31 Jul 2007 13:02:55 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: The commented codes in a macro still run
Content-Type: text/plain; format=flowed
Ill skip the Macro design issues and the resulting data step code issues
since we need for the time being to focus on a more basic issue.
In teh macro facility there are 2 types of comments the /* <some text */
and %* <some Text> ; I would say the easiest and safest to use in a %Macro
is the %* <text> ; form I say this because you can have some issues with
commenting when you use /* <text here> */.
The *<Text> ; is only valid in open code. This explains why you see some of
your macro variables getting resolved. YOu havent commented them out from
the macro facility.
Just because you comment every thing between the %Macro and %Mend doesnt
mean nothing will be put to the log, in fact when SAS compiles the macro
definition it will echo the definition to the log.
If anything simply cannot go wrong, it will anyway. Murphys Law #2.
The buddy system is essential to your survival; it gives the enemy somebody
else to shoot at.
Murphys Law #
Tell a man there are 300 billion stars in the universe and he'll believe
you. Tell him a bench has wet paint on it and he'll have to touch to be
sure. Murphys Law #9
From: Gimmy Tang <gimmytang@GMAIL.COM>
Subject: The commented codes in a macro still run
Date: Tue, 31 Jul 2007 12:39:05 -0000
I wrote a macro that can do somthing. The funny thing is that if I put
all the codes in this macro as comments, it runs as if these codes
were actually executed. The macro is put below. As you can see, all
the lines except the header and end are commented and there should be
NO output in the log window. However each time I submit
this script the lines of ''%put &numfiles'' and ''%put &filename1''
are read and the results will be written in the log window.
Can anyone kindly bring some idea of this happening?
%let directory = r:\sas\ncaa;
/* Initialize data set that will contain all files in long form */
* %if &numfiles > 0 %then %do;
* data one;
* length filename filename2 filenamem $100;
* %do i = 1 %to &numfiles;
if _n_ ne 1;