Help using Base SAS procedures

Get SAS data set from proc freq

Accepted Solution Solved
Reply
Regular Contributor
Posts: 208
Accepted Solution

Get SAS data set from proc freq

[ Edited ]

Hello all,

 

I want get SAS data set instead of output.

 

 

proc freq data =sashelp.class ;
table sex / MISSING ;

          output out=need;/*not work*/
run;

 

 

I want to generate a SAS data set with data like this:     (two rows,5 variables):

 

 

 

Sex    Frequency    Percent      Cumu_Frequency    Percent
F                9              47.37                   9               47.37
M              10             52.63                   19             100.00

 

 

How to program?

 

Thanks!


Accepted Solutions
Solution
‎05-03-2017 04:45 PM
Super User
Posts: 17,864

Re: Get SAS data set from proc freq

Use OUT on the TABLE statement.

Note that I also used the NOPRINT option so you don't have output that goes to the Listing or HTML output. This is optional, but I find useful feature.

 

proc freq data=sashelp.class noprint;
table age*sex / out=want;
run;

 

 

View solution in original post


All Replies
Solution
‎05-03-2017 04:45 PM
Super User
Posts: 17,864

Re: Get SAS data set from proc freq

Use OUT on the TABLE statement.

Note that I also used the NOPRINT option so you don't have output that goes to the Listing or HTML output. This is optional, but I find useful feature.

 

proc freq data=sashelp.class noprint;
table age*sex / out=want;
run;

 

 

☑ This topic is SOLVED.

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

Discussion stats
  • 1 reply
  • 150 views
  • 1 like
  • 2 in conversation