LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 25 Nov 2002 15:48:43 +0100
Reply-To:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:   To: "Karl K." <karlstudboy@HOTMAIL.COM>
Comments:   cc: Quentin and Amanda McMullen <qandamcmullen@POP.MAIL.RCN.NET>
From:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject:   Re: macro resolution inside *-comments
Content-Type:   text/plain; charset="iso-8859-1"

Hi Quentin and Karl,

The following program shows, that macros and macro variables are not resolved within comments. Run it once like this and once with an empty macro variable FirstCh.

=========================== %LET FirstCh = *;

%MACRO Comment; CALL EXECUTE ('%LET MacroRun=Macro run;'); %MEND Comment; %LET Comment = CALL EXECUTE ('%LET Resolved=Macro value resolved;')%STR(;);

DATA _NULL_; &FirstCh %Comment; &FirstCh &Comment; RUN;

%PUT MacroRun=&MacroRun.; %PUT Resolved=&Resolved.; ===========================

Regards - Jim. -- Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070 senior statist./data man. P.O. Box 1 fax. +31 412 407 080 5350 AA BERGHEM, NL

My computer does what I tell it to do; sometimes it says my instructions are illegal.

Notice of confidentiality: this e-mail may contain confidential information intended for the addressed recipient only. If you have received this e-mail in error please delete this e-mail and please notify the sender so that proper delivery can be arranged.

> -----Original Message----- > From: Karl K. [mailto:karlstudboy@HOTMAIL.COM] > Sent: 25 November 2002 14:57 > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: macro resolution inside *-comments > > > If I'm reading you correctly, I'm not really seeing a "comment". An > asterisk denotes a comment at the beginning of a STATEMENT, not the > begining of a line of text. There's no semi-colon after > "%bad", so the > next line isn't really a comment. > > (The following code is untested.) > > For example, if we define %bad as something like: > %macro bad; > %str(proc freq; table x); *note no semicolon inside the > %str function; > %mend; > > Then the SAS code: > %bad > * whatever; > > Resolves to: > > proc freq; table x * whatever; > > Perfectly legal executable code, without any comments, right? > "* whatever" is part of the table statement in proc freq, not > a comment. > > If I'm missing your point, my apologies > > Karl >

Back to: Top of message | Previous page | Main SAS-L page