Date: Thu, 5 Feb 2004 13:53:05 -0500
Reply-To: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Subject: Re: String literal with embedded hex ?
"Jack Hamilton" <JackHamilton@FIRSTHEALTH.COM> wrote in message
news:s0215328.074@SLCM02.firsthealth.com...
> A bit complicated, but it seems to work:
>
> =====
> data x;
> text="Line 1%sysfunc(inputc(0A, $hex2.))Line 2";
> put text= text=$hex40.;
> run;
> =====
>
> prints
>
> =====
> 64 data x;
> 65 text="Line 1%sysfunc(inputc(0A, $hex2.))Line 2";
> 66 put text= text=$hex40.;
> 67 run;
>
> text=Line 1Line 2 text=4C696E6520310A4C696E652032
> NOTE: The data set WORK.X has 1 observations and 1 variables.
> =====
> --
Jack:
Very nice. Thanks.
I ended up doing
%macro hex(codes);
%sysfunc(inputc(&codes,$HEX%length(&codes).))
%mend;
data x;
text = "Line 1%hex(0A)Line 2";
put text $HEX40.;
run;
I can also submit
DM "POSTMESSAGE ""Line 1%hex(0A)Line 2""";
--
Richard A. DeVenezia
http://www.devenezia.com
|