Date: Thu, 3 Apr 1997 10:53:13 -0800
Reply-To: Jack Hamilton <Jack_Hamilton@HCCOMPARE.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Jack Hamilton <Jack_Hamilton@HCCOMPARE.COM>
Organization: HealthCare COMPARE
Subject: Re: assigning special character to macro variable
Content-Type: text/plain; charset=us-ascii
Karsten Self wrote:
>Your %sysfunc example is attempting to assign a macro whitespace value to a
>macrovarible. You'd have to use %STR() or some other quoting mechanism to
>properly pass the value as the sole portion of a macrovariable -- you would
>have had a legal assignment if a non-whitespace character had preceeded the
>tab.. If you were developing an application to accept arbitrary hex codes
>to be converted to character values and used in macrovariable assignment,
>you would be best advised to use %NRBQUOTE(), which would avoid the possible?problems of the macro interpreter attempting to resolve '&' and '%' (the
>'nr' (no resolve) part), and not balancing single or double quotes (the 'b'
>(balance)) part.
Before I sent my earlier note, I had tried lots of different quoting options,
including %NRBQUOTE, and none of them produced the desired result. I think
the lesson is that only printable characters should be used inside macro
strings. Some special characters will cause the macro facility to break
if you're not careful.
I think we need to know what the original poster wanted to do; there might be
an alternative.
-----------------------------
Jack_Hamilton@HCCompare.com
HealthCare COMPARE Corp.
West Sacramento, CA
|