BookmarkSubscribeRSS Feed
ksnyder1
Calcite | Level 5

I'm having an issue with my underlines not fully covering all the text I am trying to underline. The code I am using is:

 

ods text='^S={font=("Times New Roman",8pt,bold) textdecoration=underline}RECIPIENT DATA';

But the output is showing as this:

 

 

sampleunderline.png

 

We are using SAS 9.4.

 

Thanks!

7 REPLIES 7
RW9
Diamond | Level 26 RW9
Diamond | Level 26

That looks to be more the renderer than SAS.  What is the output destination?  Is it Word (which is notoriously bad at headings and such like since the Navigation object came in).

ksnyder1
Calcite | Level 5

I'm outputting straight to an adobe acrobat pdf.

ballardw
Super User

Does it work without the BOLD?

I'm thinking that what ever calculates lengths might not quite get the character modification from the BOLD option correct. Try the "Times New Roman Bold" font if you have it available.

ksnyder1
Calcite | Level 5

Even completely removing the font statement from the style statement doesn't fix it.

 

Could the regions and proc report directly below it have an impact?

 For example this section does the same thing:

 

ods layout start width=7in height = 11in;
ods region x = .25in y = 0in width= 4in height = 4in;
ods text = '^S={font=("Times New Roman",8pt,bold) textdecoration=underline}EMPLOYER RENEWAL FORMS';
ods region x = .25in y = .25in width= 4in height = 4in;
proc report data=renewal_data&yr.;
	columns status cnt;
	
	define status / display '' style=[cellwidth=2.0in];
	define cnt    / display '' format=comma9. style=[cellwidth=0.5in];
run;
Cynthia_sas
SAS Super FREQ
Hi, I doubt that the PROC REPORT step would be impacting the ODS TEXT=. When I ran this simple test, just using nothing but ODS TEXT and a modified form of your style override, I got the same results. I was playing around with font and size and bold separately and I wanted to be sure they were all separate, so I split out the FONT= that you had into separate values. I also played with the "old" syntax vs the "new" syntax and that didn't make a difference.

I think you should open a track with Tech Support on this.

Cynthia

My test code:
ods escapechar='^';

ods pdf file='c:\temp\test_underlineyyy.pdf' startpage=no;
ods text='^S={fontfamily="Times New Roman" fontsize=8pt fontweight=bold textdecoration=underline}RECIPIENT DATA';
ods text='^{style[fontfamily="Times New Roman" fontsize=8pt fontweight=bold textdecoration=underline]RECIPIENT DATA}';
proc print data=sashelp.class(obs=3);
run;
ods pdf close;
Ksharp
Super User

It worked for me. 

Can you pad some characters after it and make underline longer ?

 


ods pdf file='/folders/myfolders/x.pdf';
ods escapechar='^';
ods text="^S={font=('Times New Roman',8pt,bold) textdecoration=underline}RECIPIENT DATA ^S={color=white}dummy";
proc print data=sashelp.class;run;
ods pdf close;
boschy
Fluorite | Level 6

A customer raised the same problem. I tried TEXTDECORATION = UNDERLINE, but did not work for ODS TEXT for whatever reason.

 

Only the following PROC ODSTEXT statement gave acceptable results in the PDF document. I also noted that PROC ODSTEXT does not inherit the UserText style elements that ODS TEXT uses.

 

proc odstext;
   p "BUSINESS RULES" /
       style=[font_size = 10pt
                 foreground = black
                 font_weight = bold
                 borderbottomcolor = black
                 borderbottomwidth = 0.1pt
                 background = white];
run;

 

/* The next line also needed a top margin to apply line spacing */

ods text = "^S={font_size = 8pt font_style = italic margintopwidth = 8pt}Incidents Reported is based on head office received date.";

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
  • 7 replies
  • 6170 views
  • 1 like
  • 6 in conversation