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
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.