I have reviewed all of the topics in this community and on the web and I am still unable to add superscript to my footnotes or titles. Any help
woild be greatly appreciated. Below please find my test code:
data have;
infile datalines;
input year 4. pats_stage1_3 pats_total 3. ;
datalines;
1999 150 300
2000 112 369
2001 236 426
2002 121 400
2003 330 520
2004 280 500
;
run;
ods graphics on;
ods escapechar= '^';
ods excel file='/home/luvscandy270.xlsx'
options(sheet_name="test" embedded_titles="yes" embedded_footnotes="yes" TITLE_FOOTNOTE_NOBREAK="yes");
proc sgplot data=have noborder;
title 'TEST ^{super (b)}';
series x=year y=pats_stage1_3 / legendlabel="Male" lineattrs=(color=blue thickness=3) markers
markerattrs = (symbol = circlefilled color = blue size=10);
series x=year y=pats_total / legendlabel="Female" lineattrs=(color=green thickness=3) markers
markerattrs = (symbol = circlefilled color = green size=10);
xaxis label='Test' discreteorder=data fitpolicy=rotatethin valuesrotate=vertical ;
yaxis label = 'Test' values=(0 to 600 by 100) valueattrs=(family=arial size=10pt ) minor grid ;
reg x=year y=pats_stage1_3 / nomarkers lineattrs=(color=blue pattern=dash) legendlabel='Regr. stage 1-3';
reg x=year y=pats_total / nomarkers lineattrs=(color=green pattern=dash) legendlabel='Regr. total';
keylegend / location=inside position=top title="" valueattrs=(size=7pt family=arial) outerpad=(top=0.2cm) border;
footnote1 h=5pt justify=l 'Test ^{super (b)}';
footnote2 h=5pt justify=l 'Test 2';
run;
ods excel close;
It doesn't seem to work for me with PROC SGPLOT but it works for other PROCs.
ods escapechar="^";
title 'Example Alpha^{super 2}';
proc print data=sashelp.class(obs=4);
run;
proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;
you could with play with annotations:
data have;
infile datalines;
input year 4. pats_stage1_3 pats_total 3. ;
datalines;
1999 150 300
2000 112 369
2001 236 426
2002 121 400
2003 330 520
2004 280 500
;
run;
ods graphics on / WIDTH=800px HEIGHT=800px;
ods escapechar= '^';
ods excel file='R:\luvscandy270.xlsx'
options(sheet_name="test" embedded_titles="yes" embedded_footnotes="yes" TITLE_FOOTNOTE_NOBREAK="yes");
title1
h=2 color=white "phantom"
;
data anno;
function="text";
length label $ 50 ANCHOR $ 10;
label="TEST for title(*ESC*){sup '(b)'}";
ANCHOR="TOP";
X1SPACE="GRAPHPERCENT";
X1=50;
Y1SPACE="GRAPHPERCENT";
Y1=96;
TEXTWEIGHT='BOLD';
TEXTSTYLEELEMENT="GraphTitleText";
WIDTH=100;
output; /* title */
X1=5;
Y1=5;
TEXTSTYLEELEMENT="GraphFootnoteText";
label="TEST for footnote (*ESC*){sup '(b)'}";
ANCHOR="TOPLEFT";
output; /* footnote */
run;
proc sgplot data=have noborder sganno=anno;
series x=year y=pats_stage1_3 / legendlabel="Male" lineattrs=(color=blue thickness=3) markers
markerattrs = (symbol = circlefilled color = blue size=10);
series x=year y=pats_total / legendlabel="Female" lineattrs=(color=green thickness=3) markers
markerattrs = (symbol = circlefilled color = green size=10);
xaxis label='Test' discreteorder=data fitpolicy=rotatethin valuesrotate=vertical ;
yaxis label = 'Test' values=(0 to 600 by 100) valueattrs=(family=arial size=10pt ) minor grid ;
reg x=year y=pats_stage1_3 / nomarkers lineattrs=(color=blue pattern=dash) legendlabel='Regr. stage 1-3';
reg x=year y=pats_total / nomarkers lineattrs=(color=green pattern=dash) legendlabel='Regr. total';
keylegend / location=inside position=top title="" valueattrs=(size=7pt family=arial) outerpad=(top=0.2cm) border;
run;
footnote1
h=1 color=white "phantom"
;
ods excel close;
Bart
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.