sas >> How to put special symbol in text

by sophiDT » Wed, 11 Apr 2007 04:38:47 GMT

Dear list gurus,

I am trying to hard coding some text according to SAS output and I need
specific symbols to represent different things. for example: if p<0.05 then
label='women*', or label='Hisp^', what I have been trying to do is first,
get special symbol from word, then copy-past to SAS, found that SAS
automatically convert to regular alphabet letters instead of the symbol I
want. Any one knows how to put special symbols in SAS? I am program this
in data step, it's not related to graph at all.

Many thanks in advance.


sas >> How to put special symbol in text

by NordlDJ » Wed, 11 Apr 2007 07:11:50 GMT

> -----Original Message-----


I haven't seen a reply to your question, so I will take a stab at it. It will probably depend on your OS (some flavor of MS Windows I presume), the character encoding used on your computer, fonts available, etc. I couldn't tell what characters you were trying to use from your email. So, the code snippet below puts the hex code for the "paragraph" symbol into a string and prints it to the log file. I hope this at least gives you an idea of how to proceed. If not, write back to SAS-L with more specifics and maybe we can still help.


Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204

sas >> How to put special symbol in text

by sophidt » Wed, 11 Apr 2007 09:27:46 GMT

Hi Dan,

Thanks for your response, were you meant to provide some code but you
didn't, or you are already provide the 'code' that I am not knowledge enough
to figure out? I am confused.

Would please provide a little more advice?


Download Messenger. Join the i Initiative. Help make a difference today.

How to put special symbol in text

by sbarry » Wed, 11 Apr 2007 10:53:07 GMT

A Google (advanced) search for the support site revealed
several document references -- here's the search I entered (site: in
lowercase limits the search to only the SAS.COM domain resources):

+insert +"escape character"

Scott Barry
SBBWorks, Inc.

How to put special symbol in text

by NordlDJ » Wed, 11 Apr 2007 13:22:24 GMT

> -----Original Message-----

I apologize for not pasting in the example code. Here it is:

data _null_;
new_label="here is a paragraph symbol: "||symbol;
put new_label=;

'b6' is the hexadecimal value for the paragraph marker (which I got from MS Word). I input the value as a character value and then concatenated it to a label string. You should be able to do something similar for whatever symbols you wish to include in your labels.

Hope this is helpful,


Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204

How to put special symbol in text

by sophidt » Thu, 12 Apr 2007 00:50:02 GMT


Thank you so much for your code. Below is the code for searching the
symbols, combining with yours, people would be able to search the symbols
they want and put them in the place they want.

data _null_;
do i=1 to 255;
put x= x=hex.;

Thank you again,


Exercise your brain! Try Flexicon.

How to put special symbol in text

by davidlcassell » Thu, 12 Apr 2007 11:05:25 GMT

When you're doing this, you have to be careful. This is not a Word
problem, or a SAS problem. It is an OS problem. The way that a symbol
comes out can depend on the codepage, the NLS, the font you are
using, Unicode, ....

So the bottom line is that the way the special character will come out
is going to depend on what your end-users use to view the report. If
two different end-users use two different programs, or the same program
set up differently on two different machines, this may work for one of
them and *not* for the other.

Need a break? Find your escape route with Live Search Maps.

Similar Threads

1. special symbols in SASGRAPH

2. display special characters/symbols

Hi all.

Just wondering if anyone please teach me what are the SAS statements
to allow SAS to output special characters/symbols such as ,  etc..

Thanks a lot.

Have a great day.

3. Special symbols in variable labels

4. special symbols

hi, I want to show some special symbols using following code, but it did
not work in this way. SAS doesn't see x as a hex code which I intended to
make. Could you show me the right way?

Many thanks,

data x;
do i=34 to 255;
  x="this"||"'"||hexi||"'"||'x'||" value";
put i= hexi= x=;

ods rtf file='symbol.rtf;
proc print data=x;
ods rtf close;

5. Including special symbols in labels

6. gplot: Symbols disappear if special order in legend


In a graph there was trouble getting the symbols in the legend when I had a
special order of the names in the legend:

legend1 position=(top center) label=none order=('Placebo' '130 ug'
'225 ug' '350
ug' '550 ug') shape=symbol(*0.00001*,*2.5*) frame;

When I didn't have the order statement, it was fine. Is there a way to get
both the order and the symbols?


7. add special symbol

8. Subscript special symbol in ods output


How can I get a normal script after a subscript of a special symbol
(tau in this case)?

The following code makes everything after AUC a subscript, but I need
(h*ol/L) to be normal.

ods escapechar = ';
"AUCsub u964} (h*ol/L)"

Kind Regards,