Newsgroups: comp.soft-sys.sas
From: datan...@GMAIL.COM ("data _null_,")
Date: Mon, 7 Apr 2008 12:54:30 -0500
Local: Mon, Apr 7 2008 1:54 pm
Subject: Re: Macro variable resolves to - question
You have mentioned when BQUOTE works but superQ does not but not
example and Chang has provided example where BQUOTE does not produce the desired result. Can "we" SAS-L make some kind of example or table that summarize all this. The topic has my head spinnin'. On Mon, Apr 7, 2008 at 12:25 PM, toby dunn <tobyd...@hotmail.com> wrote:
> Gerhard , > To understand what Data _Null_ is talking about you have to go back and follow the link from the Elvis dudes web page. There you will find the the offending code and it will make Data _Null_'s post make sense. > Since Data _Null_ invoked my name Ill comment on this. %SuperQ in my view is far superior to %BQuote or the double quote method. I have only seen one example were %BQuote was even neccessary and it made sense to use it over %SuperQ. The double quote method has more problems with it than you can shake a stick at and should be avoided its an old hack solution when working with Macro comparisions and does nothing but add to the list of possible errors, add more typing, and more confusion over all. If one wants to decide whether a variable is empty then the judicious use of %Length would be a better option than all this crazy looking crap I have seen with no right hand side values in a implicit or explicit %eval statements. Clarity as to the intent and funtionality of the code should be one of most important goals in programing. > In short if you think or find yourself needing more than: %Str, %NRSTR, %SuperQ, %BQuote (only once in a great blue moon), or %Unquote then perhaps one should stop and ask whether they needto be writing a macro at all and if their approach to the problem is teh correct one. > Toby Dunn > "Don't bail. The best gold is at the bottom of barrels of crap." > "Be prepared. Luck is where preparation meets opportunity." > > Date: Mon, 7 Apr 2008 12:58:50 -0400 > > Hi datanull, > > %let a=Alice; > > data a; > > ???? don't know what I could here with macro-functions. > > and that I don't understand: > > If &risk="" THEN test=1; > >>>> %macrotest() > > where is %macrotest? Should the>>If &risk="" THEN test=1<< be macro-code? > > Else If &risk="ab" RHEN test=2; > > mean? > > Ok, maybe ... THEN test=2; > > But how does the whole code look like? Is the above (and below) a part of > > %if .... %then .... %do; ??? > > Gerhard > > On Mon, 7 Apr 2008 10:47:39 -0500, data _null_, wrote: > >>I looked a the tip you referenced and your 5 other tips. I do not > >>%bQuote should provide the necessary quoting in most cases. I have > >>For example, > >>%if %bquote(&arg) eq %then %do..... > >>On Mon, Apr 7, 2008 at 6:08 AM, wrote: > >>> Your question has been answered already, but you might also like to > >>> http://www.oview.co.uk/sastips/st2_macro_quoting.htm > >>> Regards, > >>> Chris. > >>> On 5 Apr, 14:34, stefan.p...@ISH.DE (Stefan Pohl) wrote: > >>>> I have a macro variable risk which can be empty or ab. > >>>> If &risk="" THEN test=1; > >>>> %macrotest() > >>>> risk does not resolve in the coorect way if risk is empty. > >>>> Do I have to assign risk always a character string which cannot be > >>>> Stefan. > _________________________________________________________________ You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
