|
Properly,
Given the latest definition of your problem, I still recommend using one
of the SAS procs. Does the following proc summary do what you want?
data have;
input var1 var2 var3;
cards;
1 . 3
2 3 .
. 4 5
6 . 8
;
proc summary data=have;
var _all_;
output out=missing (drop=_:) nmiss=;
run;
Art
-------
On Mon, 17 Mar 2008 16:31:23 -0700, Properly <irain168@GMAIL.COM> wrote:
>What I wanted to do is that, I want to create new dataset 'missing'
>which include the number of missing values for each variables.
>However, my original program (I successfully changed it to fit a large
>data set with the help of ART thanks!) shows only 600 variable names
>like: missing_var 1,2,3.....600. How can I change the variable names
>to the corresponding variables in the original dataset like 'ID, name,
>age, gender.....'? What I tried to do is to rename the variable to the
>original name after getting the total missing observations for the
>variable. But it does not work. How to fix this or are there any
>better ways? Thanks so much!
>
>By the way who can explain what does the "end=eof" and "if eof then
>output" mean?
>
>Thanks $B!* (B
>
>data missing (keep=missing_var:);
>
> set originaldataset end=eof;
> array all(*) _all_;
> array missing_var(600);
> retain missing_var;
>
> do i=1 to dim(all);
> if missing(all(i)) then missing_var(i)+1;
>
>
>rename missing_var(i)=all(i);
>
>
> end;
> if eof then output;
>run;
>
>Proc print data=missing;
>run;
|