BookmarkSubscribeRSS Feed
R_Win
Calcite | Level 5
Hi i have a data set

data d;
input name $ age;
cards;
23 nani
45 rahul
34 muni

Now i want the no of missing and no missing observations in that obseravions

Message was edited by: Main

Message was edited by: Main Message was edited by: Main
1 REPLY 1
data_null__
Jade | Level 19
[pre]
* Test data;
data class;
set sashelp.class;
if _n_ in(3,5,7) then call missing(of _character_);
if _n_ in(4,8) then call missing(of _numeric_);
run;

* group data as missing or non-missing;
proc format;
value miss ._-.Z = '2' other='1';
value $miss ' ' = '2' other='1';
run;
* count;
ods listing close;
proc freq data=class;
tables _all_ / missing;
format _character_ $miss. _numeric_ miss.;
ods output oneWayFreqs=OneWayFreqs;
run;
ods listing;

* prepare data for display;
data Report(keep=Var N Nmiss);
length Var $32;
array _ns[2] N Nmiss;
do until(last.table);
set OneWayFreqs;
by table notsorted;
var = scan(table,-1);
_ns(input(vvaluex(var),F1.)) = Frequency;
end;
run;
proc print;
run;
[/pre]

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 760 views
  • 0 likes
  • 2 in conversation