BookmarkSubscribeRSS Feed
jmck
Fluorite | Level 6

I am formatting a report in Proc Report on SAS Viya. I have a column of data that has several Pathogen names. I need to italicize part of the name. For instance, for Salmonella spp., I only need the Salmonella portion italicized. I am using the following compute command:

 

compute Pathogen ;
if Pathogen="Salmonella spp." then do ;
Pathogen='^{style[fontstyle=italic]Salmonella}^';
end ;
endcomp ;

 

It works except it is truncating my variable to show only Salmo in italics. Anybody know why it isn't printing the whole word? Once I fix that, how do I add the "spp." back on in non-italics? THANKS!!! (should also mention I'm using ods escapechar="^")

1 REPLY 1
PaigeMiller
Diamond | Level 26

Use the ODS ESCAPECHAR command and the appropriate modifications of you text string. Examples: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p11xia2ltavr8ln17srq8vn4rnqc.htm#p0xwm6...

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 632 views
  • 0 likes
  • 2 in conversation