The answer by @Ksharp for the question related to "Applying superscript to a variable instead of text" was very much helpful and thanks to him once again for that.
I was thinking if it is possible to italicize the text by same way (that is by changing sub or super keyword by some other keyword like italic). If anyone knows about it, please let me know.
Kindly note that it is not the text in title which needs to be italicized but the value in a variable which needs to be italicized.
Thanks in advance! 🙂
- Dr. Abhijeet Safai
Yes. You can.
data have;
set sashelp.class;
if age >14 then super=cats('(*ESC*){style [font_style=italic]',name,'}');
else super=name;
run;
ods excel file='c:\temp\temp.xlsx';
proc report data=have nowd;
column name age super;
define name/display;
run;
ods excel close;
Yes. You can.
data have;
set sashelp.class;
if age >14 then super=cats('(*ESC*){style [font_style=italic]',name,'}');
else super=name;
run;
ods excel file='c:\temp\temp.xlsx';
proc report data=have nowd;
column name age super;
define name/display;
run;
ods excel close;
Wonderful!
Many many thanks @Ksharp !
- Dr. Abhijeet Safai
Alternatively, we can use 'style' attributes in proc report directly.
eg.
ods excel file='want.xls';
proc report data=sashelp.class;
column age name sex;
define name/'Name' display;
define age/'Age' display;
define sex/'Sex' display;
compute name;
if age > 14 then call define(_col_, "Style", "Style=[fontstyle=italic font_weight=bold]");
endcomp;
run;
ods excel close;
result.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.