Hi all,
Given this file,
DATA HELLO;
year=2004; deptcode="Sales"; output;
year=2005; deptcode="HR";output;
year=.; output;
year=2007; deptcode="Logistics";output;
run;
the following program returns a nice table showing the count of missing and non-missing obs :
proc iml;
use HELLO nobs nobs;
read point 1 var _NUM_ into x[colname=nNames];
read point 1 var _CHAR_ into x[colname=cNames];
Names = nNames || cNames;
nmiss = j(1,ncol(Names));
n = nmiss;
do i = 1 to ncol(Names);
read all var (Names[i]) into x;
nmiss[i] = countmiss(x,"col");
n[i] = nobs - nmiss[i];
end;
close HELLO;
rNames = {" Missing", "Not Missing"};
cnt = nmiss // n;
*create beta ;
*append from cnt[r=rNames c=Names label=""];
*close beta;
print cnt[r=rNames c=Names label=""];
quit;
I am seeking help to save the output table into a file. I wrote an APPEND command (see three lines in green) but the log keeps yelling at me for an error.
Thanks.