BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi any one can tell me the following problem.
I have dataset name called xx,having variable name called x, x contains thefollowing data:
2
3
5

Now i want to run freq on xx.

proc freq data=xx;
tables x/out=ss;
where x=4;
run;
now i want to get output data set ss as count=0 percent=0% to get this what option i should use.

thanks and regards.
ram.
1 REPLY 1
data_null__
Jade | Level 19
You could take advantage of features of PROC SUMMARY that allow you to manufacture data. Also the ZEROS option on the WEIGHT statement in PROC FREQ.


data test;
input x @@;
cards;
2 3 5
;;;;
run;
proc format;
value fx 1='1' 2='2' 3='3' 4='4' 5='5';
run;
proc summary nway completetypes;
class x / preloadfmt;
format x fx.;
output out=work.full;
run;
proc freq data=full;
tables x / out=ss(where=(x eq 4));
weight _freq_ / zeros;
run;
proc print;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

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