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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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