Adding a Degree special character

Reply
Contributor
Posts: 24

Adding a Degree special character

Dear all,

can anyone provide the most efficient/simple syntax to add a degree sign (like for temperature in a vital signs table) to a display colum header in proc report?

thank you, Jill1

Contributor
Posts: 24

Re: Adding a Degree special character

excuse typo on column * Smiley Happy
PROC Star
Posts: 7,363

Re: Adding a Degree special character

Don't know where you want to include it, but you can type it directly. Hold the alt key down and, while you have it depressed, enter 0176 using your numeric keypad, then release the alt key. e.g.: °

 

Art, CEO, AnalystFinder.com

 

Contributor
Posts: 24

Re: Adding a Degree special character

holy toledo! what a great idea. SO SIMPLE. so much better than tons of confusing rtr code .

ps( I needed to insert the degree sign in a column heading in a proc report for "Oral Temperature (C)"
I needed to put it before the 'C' (obviouslySmiley Happy

thanks, Jill
Trusted Advisor
Posts: 1,130

Re: Adding a Degree special character

[ Edited ]

You could also create a macro variable with the degree sign using the byte function as below. You could then use the same macro variable in the column headings where you want to display the degree sign

%let degree=%sysfunc(byte(176));
%put &degree;

Thanks,
Jag
SAS Super FREQ
Posts: 8,743

Re: Adding a Degree special character

Hi,

  And for completeness, to insert special symbols into your PROC REPORT or other Headers or Titles, using the ODS ESCAPECHAR Unicode function, you only need to declare you Escape Character (shown as '^' below) and then use the Unicode number for the symbol you want.

 

cynthiause_unicode.png

Contributor
Posts: 24

Re: Adding a Degree special character

Ah, thanks, another very concise way to do this. THANKS!

Contributor
Posts: 24

Re: Adding a Degree special character

Thanks ..do you mind showing me the syntax to include a macro variable the  DEFINE stmt? thank you!

 

 

DEFINE TEMP   / display "Oral Temperature|(°C)"

SAS Super FREQ
Posts: 8,743

Re: Adding a Degree special character

Hi:
Which piece of the DEFINE statement would you want to replace with a macro variable?
DEFINE &vaname / display "Oral Temperature|(°C)";
or
DEFINE TEMP/ &usage "Oral Temperature|(°C)";
or
DEFINE TEMP/ display "&label";
or
DEFINE &varname/ &usage "&label";

No matter where you would use macro variable, you'd have to create/assign the values with either a %LET or CALL SYMPUT or using SQL and INTO.

%let varname=TEMP;
%let usage = display;
%let label = %str(Oral Temperature|(°C));

cynthia
Contributor
Posts: 24

Re: Adding a Degree special character

Thanks Cynthia!

all good stuff.
I was trying to add &degree to the display statement label (see below). I wasn't sure if you could add a macro variable directly in to a display statement. now I see it's pretty straightforward. This is how I created the degree macro:

%let degree=%sysfunc(byte(176)); /* degrees */

I guess long and short of it is that I am experimenting with different ways to put a special character in a proc report.


regards, Jill
Ask a Question
Discussion stats
  • 9 replies
  • 195 views
  • 3 likes
  • 4 in conversation