I am using proc SGPLOT to produce scatter plots. When I attempt to use ^n to force title text to a new line, I receive the above error. What I can do to address this? I also tried a line feed command and this also failed.
Hi:
This code worked for me in SAS 9.4 in all 3 destinations, including the TAGSETS.RTF destination.
cynthia
ods tagsets.rtf file='c:\temp\tr_use_esc.rtf' nogtitle;
ods rtf file='c:\temp\orig_rtf_use_esc.rtf' nogtitle;
ods pdf file='c:\temp\use_esc.pdf' nogtitle;
ods escapechar='^';
title 'This is line 1^nThis is line 2';
proc sgplot data=sashelp.class;
vbar age / response=height stat=mean;
run;
ods _all_ close;
Can you include sample code that replicates your problem with a SASHELP dataset?
Hi,
You posted this question in 2 separate forums. I answered over in the Graphics forum, but I'll make the same comment here. Even knowing that you used ^n and that it's "not working", it is hard for anyone to make a constuctive suggestion without having more information. For example, seeing your full code and understanding your ODS destination would be useful. Some ODS destinations have GTITLE (keep the title in the graph) and NOGTITLE (allow ODS to control the title) options that you can use. Generally, you would want to use NOGTITLE to allow ODS to "receive" the ESCAPECHAR. However, without more information from you, that might or might not be the problem. For example, does your destination even support NOGTITLE? What destination did you use? Where did you use the code? Why did you use ODS ESCAPECHAR instead of multiple TITLE statements.
I suggested that you might try working with Tech Support on this question.
cynthia
BTW -- this code worked for me with ODS PDF to use ODS ESCAPECHAR.
ods _all_ close;
ods pdf file='c:\temp\use_esc.pdf' nogtitle;
ods escapechar='^';
title 'This is line 1^nThis is line 2';
proc sgplot data=sashelp.class;
vbar age / response=height stat=mean;
run;
ods pdf close;
Actually, it was tagged ODS RTF, so that explains the issue.
Doug, ODS RTF uses different line control commands. Base SAS: ODS RTF explains in more detail. \line gives you a new line.
Hi:
This code worked for me in SAS 9.4 in all 3 destinations, including the TAGSETS.RTF destination.
cynthia
ods tagsets.rtf file='c:\temp\tr_use_esc.rtf' nogtitle;
ods rtf file='c:\temp\orig_rtf_use_esc.rtf' nogtitle;
ods pdf file='c:\temp\use_esc.pdf' nogtitle;
ods escapechar='^';
title 'This is line 1^nThis is line 2';
proc sgplot data=sashelp.class;
vbar age / response=height stat=mean;
run;
ods _all_ close;
It was the absence of nogtitle that was causing the issue. It is working fine now. Thanks!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.