ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
MaryA_Marion
Lapis Lazuli | Level 10
I want to increase fontsize for all ods text= statements. How to do? The following code does not do it but gives no error either.
Thank you. MM

ods text="^{style[font_face='calibri' fontsize=12pt] ";
ods text="Logistic Model log[ p/(1-p) ] = -3.0763 + .0687D + 1.6589T";
4 REPLIES 4
Ksharp
Super User

Put it all together .

 

ods escapechar='^';
ods text="^{style [font_face=calibri fontsize=40pt]   Logistic Model log[ p/(1-p) ] = -3.0763 + .0687D + 1.6589T  }";



proc print data=sashelp.class;run;
MaryA_Marion
Lapis Lazuli | Level 10
This works!
ods text="^{style [font_face=calibri fontsize=14pt] Logistic Model
log[ p/(1-p) ] = -3.0763 + .0687D + 1.6589T }";
ods text="Model Convergence is satisfied.";

Goal is to print out these lines. I am doing it this way because notes
are not wrapping (extend beyond viewable line on output)
ods text="Deviance/df =1.1773 ~ 1 with p-value=.2628 (not significant
at .05 level)";
ods text="Logistic Model log[ p/(1-p) ] = -3.0763 + .0687D + 1.6589T }";
ods text="Model Convergence is satisfied.";
ods text="Hosmer and Lemeshow GOF test chi-square=5.2854 with 6 df and
p-value=.5078(not significant at .05 level)";
ods text="No standardized residual is large in absolute value (>3).";
ods text="All predicted values are plausible (Bounds are between 0 and 1).";
ods text="It seems that the model does fit well.";

I am answering a series of questions so doing it your way I will need
two lines per output line.

I would like to get the following template to take care of that.
I am describing the results of a statistical procedure in SAS On
Demand. I download the results as an html file.

proc template;
define style mystyle;
parent=styles.default;
style usertext from usertext /
foreground=navy
font_size=14pt
font_weight=bold;
end;
run; quit;

/* To delete mystyle I would do the following;
ods _all_ close;
title;
footnote;
Note about code
proc template;
delete mystyle;
run;
*/

Your help is much appreciated. Thank you.

MM

ballardw
Super User

If you have a lot of text to display you might consider using Proc Odstext.

A brief example:

Proc ODStext;
p "Deviance/df =1.1773 ~ 1 with p-value=.2628 (not significant
 at .05 level). Logistic Model log[ p/(1-p) ] = -3.0763 + .0687D + 1.6589T } 
 Model Convergence is satisfied. Hosmer and Lemeshow GOF test chi-square=5.2854 with 6 df and
 p-value=.5078(not significant at .05 level). No standardized residual is large 
 in absolute value (>3). All predicted values are plausible (Bounds are 
 between 0 and 1).  It seems that the model does fit well.";
run;

The p you see is the start of a paragraph. You can use multiple P statements to start each paragraph. Text will wrap but note that continuation lines that do not start with a blank usually do not have a space before the text on the previous line.

You can provide style elements that affect the entire text as an option after the text of the P.

Proc ODSTEXT will also use a data set as source for the statements and can do some interesting things. The data set may be appropriate if you dump some standard variables from models or analysis procs (your p-values and model text for example). Then some of the output would be boilerplate and the rest the custom result from your data.

One additional advantage is the proc does not require some other procedure following to generate output in the destination like Ods text seems to require.

MaryA_Marion
Lapis Lazuli | Level 10
Thanks for stepping in. Text still is not wrapping for me. I wonder if it
could be a preference setting?

Here is where I am:

ods _all_ close;
title;
title2;
footnote;

proc template;
define style mystyle;
parent=styles.default;
style usertext from usertext /
foreground=navy
font_face=Times_New_Roman
font_size=14pt
font_weight=bold;
end;
run;
run;
*no errors but nothing happens with it either;
*I want this active the entire session so I can just enter ods text= statements;

*this is not working;
ods text="testing";

*this works;
ods escapechar='^'; ods text="^{style [font_face=Times_New_Roman
fontsize=14pt] Logistic Model log[ p/(1-p) ] = -3.0763 + .0687D +
1.6589T }";
ods escapechar='^'; ods text="^{style [font_face=Times_New_Roman
fontsize=14pt] Model Convergence is satisfied. }";

proc template;
delete mystyle;
run;


MM

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 6581 views
  • 1 like
  • 3 in conversation