简体   繁体   中英

Proc Freq into a dataset in SAS Studio

I have a data (colour) that looks something like

Id haircolour 1 black 2 brown 3 grey .....

And using proc freq I got a table that looked like

Haircolour Frequency Black 10 Brown 20 Grey 30

Is there any way for me to save this table as a new sas file with haircolour and frequency as the variables?

Thanks Tim

There are two main ways to get data out of a proc. One way is to use the OUT option on the TABLES statement. Another is the ODS OUTPUT statement, however that depends on your table statement.

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

The ODS approach is outlined here. https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM