Hello
In the following proc freq example I create an output data set(out statement) and also print the output.
In the output data set there are only 3 columns: Site,Count,Percent.
In the print output there are 5 columns: Site,Count,Percent,Cumulative count,Cumulative percent.
My question is:
How can I add columns :Cumulative count,Cumulative percent to the output data set?
How can I add % symbol to the output data set for columns:Percent,,Cumulative percent?
How can I create the output data set without print it?
thanks
Joe
data summary_tbl1;
input Site $ 1-8 frq;
datalines;
Atlanta 103
Chicago 486
Dallas 195
Denver 400
New York 307
Seattle 577
;
run;
proc freq data=summary_tbl1;
tables site/out=pelet;
weight frq;
run;
You can find the options for your required outputs in the documentation for the PROC FREQ TABLES statement:
I suggest you bookmark this web link - documentation.sas.com - for future reference.
data summary_tbl1;
input Site $ 1-8 frq;
datalines;
Atlanta 103
Chicago 486
Dallas 195
Denver 400
New York 307
Seattle 577
;
run;
proc freq data=summary_tbl1;
tables site/out=pelet outcum outpct;
weight frq;
run;
proc print;run;
@Ronein wrote:
Hello
In the following proc freq example I create an output data set(out statement) and also print the output.
In the output data set there are only 3 columns: Site,Count,Percent.
In the print output there are 5 columns: Site,Count,Percent,Cumulative count,Cumulative percent.
My question is:
How can I add columns :Cumulative count,Cumulative percent to the output data set?
How about this:
ods output onewayfreqs=owf;
proc freq data=summary_tbl1;
tables site/cumcol;
weight frq;
run;
How can I add % symbol to the output data set for columns percent, Cumulative percent?
This is done via applying formats or picture formats to the values in the output data set OWF.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.