DATA Step, Macro, Functions and more

Freq Report Customization

Accepted Solution Solved
Reply
New Contributor Yen
New Contributor
Posts: 4
Accepted Solution

Freq Report Customization

data test;

input desc $;

datalines;

a1

a2

a3

a3

a2

a1

a1

a3

a2

a1

a3

a3

;

run;

 

proc freq data=test;

tables desc;

run;

 

Have:

desc Frequency Percent Cumulative
Frequency Cumulative
Percent
a1433.33433.33
a2325.00758.33
a3541.6712100.00

 

 

Want:

Summary
a1 a2a3
435

Accepted Solutions
Solution
‎07-20-2016 03:00 PM
Super User
Posts: 5,498

Re: Freq Report Customization

There are going to be ways to do this in one step, but the two-step version is easy to understand:

 

proc freq data=test;

tables desc / noprint out=counts;

run;

 

proc tabulate data=counts;

class desc;

var count;

tables count, desc=' '*sum=' ';

title 'Summary';

run;

View solution in original post


All Replies
Solution
‎07-20-2016 03:00 PM
Super User
Posts: 5,498

Re: Freq Report Customization

There are going to be ways to do this in one step, but the two-step version is easy to understand:

 

proc freq data=test;

tables desc / noprint out=counts;

run;

 

proc tabulate data=counts;

class desc;

var count;

tables count, desc=' '*sum=' ';

title 'Summary';

run;

☑ This topic is solved.

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

Discussion stats
  • 1 reply
  • 172 views
  • 0 likes
  • 2 in conversation