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:
Any help?
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;
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.
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;
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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.