☑ This topic is solved.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 04-25-2024 01:08 AM
(939 views)
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
Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Wonderful!
Many many thanks @Ksharp !
- Dr. Abhijeet Safai
Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@A_Kh, Thank you.
I remember now that it's traffic lighting! 👍
- Dr. Abhijeet Safai
I remember now that it's traffic lighting! 👍
- Dr. Abhijeet Safai
Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real