BookmarkSubscribeRSS Feed
Neeta
Fluorite | Level 6

Hi all,

I’m working on a client request where client wants some letters of the treatment name italicized (eg. 100 µg Na-APR should be displayed as 100 µg Na-APR) in ODS RTF output.

I’m using following code and its working perfectly fine for listings and tables.

 

ods escapechar = "!";

%let Na=%str(!S={font_style=italic}Na!S={});   /*** Italicise Na as per client request ***/

 

Proc report column statement:

 

column p_break day Dateline day orderc ("30 µg &Na.-APR-1 "    Actual1 Change1)

                                  ("100 µg &Na.-APR-1 "  Actual2 Change2);

  

But when I’m using same code for figures, italicizing is not working 😞

I'm getting following output:

Capture.PNG

 

Any help?

 

 

5 REPLIES 5
ballardw
Super User

I would not introduce additonal complications of macro language until you have a solution that works so that you generate the correct code with the macro.

 

You might show the code (and preferably some data) that produces the graph. Your code is Proc Report.

 

Here is one way with proc report use the RAW function to insert RTF code for italic text.

ods escapechar="^";

ods rtf file="d:\data\italic.rtf"
style=meadow notoc_data;

proc report data=sashelp.class nowd;
   column ("Some ^{raw \i Measures}" Height Weight);
   define height/display;
   define weight/display;
run;   title;
ods rtf close;
Cynthia_sas
SAS Super FREQ
I am confused about whether the ODS ESCAPECHAR is being used with PROC REPORT (should work) or with ODS GRAPHICS or SAS/GRAPH (will probably NOT work).

cynthia
Neeta
Fluorite | Level 6

First, I'm creating format, then assigning it to dose var, then creating ODS graph template and passing it to PROC SGRENDER.

Here is part of the code used to create the figure.

 

Capture.PNG

Neeta
Fluorite | Level 6

Ooops..looks like I posted wrong dose format statemnt.

The format used is as follows:

 

proc format;
value dose
1="30 µg !S={font_style=italic}Na!S={}-APR-1"
2="100 µg !S={font_style=italic}Na!S={}-APR-1";
quit;

Jay54
Meteorite | Level 14

Inline formatting will not work inside GTL.  With SAS 9.4M3, GTL does support unicode in the user defined formats, but you have to use the full ODS ESC string.  There is a HEADERATTRS option to control the font for the entire cell header, but there is no way to make just a portion of the header italic.

 

Now, you could try using a Layout GRIDDED with 2 cells with a DATALATTICE in each.  Not sure if this is supported..  Then, you can use an ENTRY for the dose that does support rich text so you could make just the "Na" in italic.

 

I am curious about columnvar=(dose grp).  This syntax was briefly supported in SAS 9.3 but never documented.  It is not well tested, so you are using a feature that is no longer supported in later releases of SAS. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 2706 views
  • 0 likes
  • 4 in conversation