BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Doug
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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;


View solution in original post

5 REPLIES 5
snoopy369
Barite | Level 11

Can you include sample code that replicates your problem with a SASHELP dataset?

Cynthia_sas
SAS Super FREQ

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;

snoopy369
Barite | Level 11

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.

Cynthia_sas
SAS Super FREQ

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;


Doug
Calcite | Level 5

It was the absence of nogtitle that was causing the issue. It is working fine now. Thanks!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 6095 views
  • 0 likes
  • 3 in conversation