BookmarkSubscribeRSS Feed
gfarkas
Calcite | Level 5

Hi all,

I'm trying to use the ODS escape character to dynamically insert a line break in the footnote of a SGPLOT chart that I'm outputting to a PDF. However, whenever I try to use "^n" (with "^" being my escape character) I get the error/warning/note in the subject line. I've tried adding "^n" to the footnote statement manuall, as well as via a macro variable.

Googling this error note didn't return anything interesting, nor did searching through the SAS help files. The relevant SAS code is below, with the "^n" in question near the end. If anyone has any suggestions on how to get this done, or knows whether or not it can be done at all, it would be much appreciated. I've been able to use other ODS tags via the escape character without issue, as you can see from the code below.

ods pdf file = "Test.pdf" BOOKMARKLIST = HIDE DPI = 300 PDFTOC = 1 UNIFORM ;

ods graphics on / reset border=OFF width=11in noscale height=8.5in ;

ods html close; ods escapechar = '^'; ods noproctitle;

title font=Times

    justify=LEFT "2014 Final Report"

    justify=RIGHT "^S={font_weight=bold}&RegionVar.^S={}"

    ;

ods proclabel = "&ChartName.";

title2 font=Times "^S={font_weight=bold}&ChartName.^S={} (Score = ^S={font_weight=bold}&ScoreVar.^S={})";

proc sgplot data=&RegionVar.5 NOAUTOLEGEND NOCYCLEATTRS UNIFORM=ALL dattrmap=RegionAttrs description = "&ChartName. (&ScoreVar.)" ;

highlow x = SourceVar high = UCLMIndiv low = LCLMIndiv / close = PredValIndiv open = PredValIndiv type = bar group = SourceNum attrid = SourceValID barwidth = 1

    highlabel = LabelVal name = "main" labelattrs = (family=Times size=10pt weight=bold) lineattrs = (pattern=Solid thickness=2) ;

xaxis display = (nolabel) DISCRETEORDER = DATA fitpolicy = STAGGER valueattrs = (family=Times weight=bold) labelattrs = (family=Times) ;

yaxis values = (&ChartLow. to &ChartHigh. by 5) valueattrs = (family=Times) labelattrs = (family=Times) ;

where IDNum = &ChartID. ;

footnote font=Times height=8pt

    justify=LEFT "CONFIDENTIAL"

    justify=RIGHT "%sysfunc(left(%qsysfunc(date(),worddate18.)))"

    ;

%if "&MissingValFlag."="Y" %then %do;

     footnote2 font=Times height=8pt

     justify=CENTER height=8pt BOLD "MISSING VALUES(S): ^n &MissingValVar.." ;

    %end;

     ;

run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 2427 views
  • 0 likes
  • 1 in conversation