Date: Thu, 28 Mar 2002 13:53:11 -0800
Reply-To: "Grichuhin, Theodore J" <tgrichuh@FHCRC.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Grichuhin, Theodore J" <tgrichuh@FHCRC.ORG>
Subject: Re: assign macro var a string with embedded nonprintable characte
r?
Content-Type: text/plain; charset="iso-8859-1"
Try double quotes. That is how we embed chinese characters.
put "My Name IS"||"BBC6D5E4C3C02020"x
yields
My Name IS»ÆÕäÃÀ
> -----Original Message-----
> From: Huang, Ya [SMTP:ya.huang@PFIZER.COM]
> Sent: Thursday, March 28, 2002 13:10
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: assign macro var a string with embedded nonprintable
> character?
>
> Hi there,
>
> I am trying to assign a string to a macro var with
> some nonprintable characters, I tried several ways,
> as you can see from the following sample code,
> only the call symput() method works. I wonder if
> it can be done by some kind of macro quoting, or
> maybe %sysfunc() to make it a one-liner?
>
> 53 data _null_;
> 54 a='abc'||'a0a0'x||'bcd';
> 55 call symput('a',a);
> 56 run;
>
> NOTE: DATA statement used:
> real time 0.01 seconds
> cpu time 0.01 seconds
>
>
> 57 %put &a;
> abc bcd
> 58
> 59 %let a=abc||'a0a0'x||bcd;
> 60 %put &a;
> abc||'a0a0'x||bcd
> 61 %let a=abc%str('a0a0'x)bcd;
> 62 %put &a;
> abc'a0a0'xbcd
> 63 %let a=abc%bquote('a0a0'x)bcd;
> 64 %put &a;
> abc'a0a0'xbcd
>
> Thanks
>
> Ya Huang
|