BookmarkSubscribeRSS Feed
deleted_user
Not applicable
data ZIPcode;
set sashelp.ZIPcode;
if msa=0 then msa=.;
label ZIP_class=" " MSA=" " CountyNm=" " AreaCode=" ";
run;


* One PROC step can handle all variables ;
proc format;
value missfmt
.="Num Missing"
other="Num Non-Missing";

value $missfmt
" "="Char Missing"
other="Char Non-Missing";

run;


proc tabulate data=ZIPCode Missing format=comma8. out=sample;
class CountyNm AreaCode MSA ZIP_Class / preloadfmt;
tables CountyNm AreaCode MSA ZIP_Class / printmiss misstext="0";
format _numeric_ missfmt. _character_ $missfmt.;
keylabel n="Count";
title1 "Missing and Non-Missing Counts for each Variable";
run;


Hi,

any one can help me


here i am using proc tabulate for finding missing and non missing count, but soma problem with the output data set. because of i have crated user defined formats.


Thanks and Regards
Saiaram.
1 REPLY 1
Doc_Duke
Rhodochrosite | Level 12
The problem is in your format statement; you are applying the missing/non-missing to everything (including the variable "n"). Change it to

format areacode msa missfmt. countynm zip_class $missfmt.;

and the sample dataset contents look right.

Doc Muhlbaier
Duke

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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