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 (February 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


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