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;

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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