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;

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →

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
  • 1751 views
  • 1 like
  • 2 in conversation