BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Daily1
Quartz | Level 8
Hi SAS Community,

I'm generating a PDF report using ODS PDF, and I want to display a heading like:
Early Childhood Education: Laying the Foundation
inside a box frame using ods text.

I tried the following code:


ods pdf file="example.pdf" style=journal;
ods escapechar='^';

ods text="^S={borderwidth=1pt bordercolor=black cellpadding=4pt 
          font_face='Times New Roman' font_size=12pt just=center} Early Childhood Education: Laying the Foundation";

ods pdf close;

Please help me with this query. Any suggestions or alternate methods are most welcome.

Thanks in advance!

I Want Like 

Daily1_0-1751977723528.png

 



1 ACCEPTED SOLUTION

Accepted Solutions
Kathryn_SAS
SAS Employee

I would recommend using PROC ODSTEXT in place of ODS TEXT as shown below:

ods pdf file="example.pdf" style=journal;
ods escapechar='^';

*ods text="^S={borderwidth=1pt bordercolor=black cellpadding=4pt 
          font_face='Times New Roman' font_size=12pt just=center} Early Childhood Education: Laying the Foundation";

proc odstext;
 p "Early Childhood Education: Laying the Foundation" / style={borderwidth=1pt bordercolor=black cellpadding=4pt 
          font_face='Times New Roman' font_size=12pt just=center};
run;

ods pdf close;

View solution in original post

2 REPLIES 2
Kathryn_SAS
SAS Employee

I would recommend using PROC ODSTEXT in place of ODS TEXT as shown below:

ods pdf file="example.pdf" style=journal;
ods escapechar='^';

*ods text="^S={borderwidth=1pt bordercolor=black cellpadding=4pt 
          font_face='Times New Roman' font_size=12pt just=center} Early Childhood Education: Laying the Foundation";

proc odstext;
 p "Early Childhood Education: Laying the Foundation" / style={borderwidth=1pt bordercolor=black cellpadding=4pt 
          font_face='Times New Roman' font_size=12pt just=center};
run;

ods pdf close;
Ksharp
Super User

Interesting. You also could get job done by ODS TEXT= :

NOTE: Do not split the row within ODS TEXT into two or three lines .

 

ods pdf file="c:\temp\example.pdf" style=journal startpage=no;
ods escapechar='^';

ods pdf text="^{style [borderbottomwidth=1px borderbottomcolor=black bordertopwidth=1px bordertopcolor=black borderleftwidth=1px borderleftcolor=black  borderrightwidth=1px borderrightcolor=black  cellpadding=4pt font_face='Times New Roman' font_size=12pt just=center]Early Childhood Education: Laying the Foundation}";

proc report data=sashelp.class nowd;run;

ods pdf close;

Ksharp_0-1752023621355.png

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 542 views
  • 2 likes
  • 3 in conversation