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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1869 views
  • 0 likes
  • 1 in conversation