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

I have the following dataset: What I would like to do is create treatment*type and have frequency (percent)

 

IDTypetreatment
12311
34322
35413
65623
44622
66521
44421
66511
65612

 

proc sort data = test; by treatment type; run; 

Here is the code I have:

proc freq data = test;

tables treatment*type / out = test2 ;

run;

 

When I run it i get the output correctly but when i export to another table it doesn't retain important characteristics such as 'Frequency' and 'Col Percent'

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

After spending 2 minutes reading the documentation, I now know that adding option OUTPCT to the OUTPUT statement does what you want.

 

Why come here and open a question without reading the documentation first?

 

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

 it doesn't retain important characteristics such as 'Frequency' and 'Col Percent'

It sure does.

proc freq data=SASHELP.CLASS; tables SEX*AGE /out=T; run;

ChrisNZ_0-1613939847144.png

 

 

ChrisNZ
Tourmaline | Level 20

oops COLPCT. Sorry. Let me look.

ChrisNZ
Tourmaline | Level 20

After spending 2 minutes reading the documentation, I now know that adding option OUTPCT to the OUTPUT statement does what you want.

 

Why come here and open a question without reading the documentation first?

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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