I am working in Proc Report with escape character="^". I am trying to apply superscript formatting to a variable and not to specific harcoded text.
For example:
I have 2 columns of data: Product and ProductCit
I would like to have 1 column where Product is the base and ProductCit is the superscript.
I've tried doing it in a compute block but can't find syntax that will take a variable name:
compute Product / character length=250 ;
Product=cat(Product,ProductCit) ;
endcomp ;
I've also tried adding it as a format to ProductCit in the define statement:
define ProductCit / display style(column)= [] ;
I can only seem to find examples where the superscript text is hard coded. Unfortunately, mine will be dynamic and I need to apply the format to the variable. Does anyone know how or have any ideas? I've been reading papers for days!
data have;
set sashelp.class;
super=cat(name,'(*ESC*){super ',age,'}');
run;
ods excel file='c:\temp\temp.xlsx';
proc report data=have nowd;
column name age super;
define name/display;
run;
ods excel close;
Pretty sure you need to add the escape character to the variable value as well and/or add some style elements to get it properly displayed.
It also likely matters what your final output destination is, RTF, HTML PDF, WORD, PPTX?
data have;
set sashelp.class;
super=cat(name,'(*ESC*){super ',age,'}');
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 @Ksharp ! Thank you!
- Dr. Abhijeet Safai
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.