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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1162 views
  • 1 like
  • 2 in conversation
OSZAR »