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

Hello there!

I have measured temperament scores (0, 1, 2, 3, 4 and 5) in 40 animals (3 and 4 years old, distributed randomly) that is divided in two treatments: Treated group and control group.
I collected the temperament in day 1, 2, 3, 4 and 5 of experiment.

 

So... I would like to know if is possible to organize these scores in percentage (%) and make a table automatically by sas. I know that I can see the percentage by PROC FREQ, but it is possible to make a table with these output datas by sas?

 

thank you.

 

Aska.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

In proc freq after the tables request add / out=datasetname.

This will only work for a single table so if you are requesting multiple tables there would have to be separate tables statement for each table with a different output data set name.

Such as

proc freq data=sashelp.class;
   tables age / out=work.agefreq;
   tables sex / out=work.sexfreq;
run;

If you are doing a crosstab you may want the OUTPCT option to capture all of the percentages

proc freq data=sashelp.class;
   tables age *sex / outpct out=work.sexagefreq;
run;

The option OUTCUM will get the cumulative count and percentage for one-way tables

View solution in original post

1 REPLY 1
ballardw
Super User

In proc freq after the tables request add / out=datasetname.

This will only work for a single table so if you are requesting multiple tables there would have to be separate tables statement for each table with a different output data set name.

Such as

proc freq data=sashelp.class;
   tables age / out=work.agefreq;
   tables sex / out=work.sexfreq;
run;

If you are doing a crosstab you may want the OUTPCT option to capture all of the percentages

proc freq data=sashelp.class;
   tables age *sex / outpct out=work.sexagefreq;
run;

The option OUTCUM will get the cumulative count and percentage for one-way tables

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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