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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

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

2 REPLIES 2
Ksharp
Super User

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

art297
Opal | Level 21

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 2502 views
  • 3 likes
  • 3 in conversation