Help using Base SAS procedures

Making proc freq pretty with ods

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

Making proc freq pretty with ods

Hello SAS users. Below of an extract of what I am working at the moment.

data test;

      input score;

      cards;

      9125

      9455

      ;

run;

ODS RTF style=Journal BODYTITLE;

ODS NOPROCTITLE;

      PROC freq DATA=test;

            TABLES score / nocol norow nopercent;

      RUN;

ODS RTF CLOSE;

While I want to keep the Journal style, I would like to;

- be able to manipulate column width so that I get more spaced out table hence easier to read

- put a comma after every 3 digits for the score

- put a total row at the bottom

Anyone has an idea?

Many thanks


Accepted Solutions
Solution
‎09-15-2011 03:50 AM
Super User
Posts: 9,681

Making proc freq pretty with ods

I think Cynthia@sas can use proc template to tailor it .

But you can always use proc report to customize the output .

data test;
      input score;
      cards;
      9125
      9455
      ;
run;

ods output OneWayFreqs=x;
      PROC freq DATA=test ;
            TABLES score / nocol norow nopercent;
      RUN; 

ODS RTF style=Journal BODYTITLE;
ODS NOPROCTITLE;
title ' ';
proc report data=x(drop= f_:) out=p nowd;
 column table score frequency cumfrequency;
 define table/display  style={cellwidth=2cm} ' ';
 define score /analysis format=comma10. style={cellwidth=2cm};
 compute score;
 if _break_='_RBREAK_' then table='Total:';
  else call missing(table);
 endcomp;
 rbreak after /summarize ;
run;
ODS RTF CLOSE;

Ksharp

View solution in original post


All Replies
Solution
‎09-15-2011 03:50 AM
Super User
Posts: 9,681

Making proc freq pretty with ods

I think Cynthia@sas can use proc template to tailor it .

But you can always use proc report to customize the output .

data test;
      input score;
      cards;
      9125
      9455
      ;
run;

ods output OneWayFreqs=x;
      PROC freq DATA=test ;
            TABLES score / nocol norow nopercent;
      RUN; 

ODS RTF style=Journal BODYTITLE;
ODS NOPROCTITLE;
title ' ';
proc report data=x(drop= f_:) out=p nowd;
 column table score frequency cumfrequency;
 define table/display  style={cellwidth=2cm} ' ';
 define score /analysis format=comma10. style={cellwidth=2cm};
 compute score;
 if _break_='_RBREAK_' then table='Total:';
  else call missing(table);
 endcomp;
 rbreak after /summarize ;
run;
ODS RTF CLOSE;

Ksharp

PROC Star
Posts: 7,363

Making proc freq pretty with ods

Take a look at: http://support.sas.com/resources/papers/freq92.pdf

It has a number of examples regarding how to change the appearance of proc freq output.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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