BookmarkSubscribeRSS Feed
NJGIRL
Obsidian | Level 7

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

10 REPLIES 10
NJGIRL
Obsidian | Level 7
excuse typo on column * 🙂
art297
Opal | Level 21

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

 

NJGIRL
Obsidian | Level 7
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' (obviously:)

thanks, Jill
Jagadishkatam
Amethyst | Level 16

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
Cynthia_sas
SAS Super FREQ

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

NJGIRL
Obsidian | Level 7

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

NJGIRL
Obsidian | Level 7

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

 

 

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

Cynthia_sas
SAS Super FREQ
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
NJGIRL
Obsidian | Level 7
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
luisymb
Calcite | Level 5

Do Direct Copy Paste Degree symbol sign

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 6209 views
  • 6 likes
  • 5 in conversation