Hi Everyone,
I am a beginner to SAS and have been using the following code to count missing values for all variables in a dataset. However, this code is printing the output in a horizontal table. I need to get in a vertical table as I have too many variables but not sure how to make that possible. By vertical I mean getting the variables as rows instead of columns. Thank you for the help in advance.
proc iml;
use MBS4;
read all var _NUM_ into x[colname=nNames];
n = countn(x,"col");
nmiss = countmiss(x,"col");
read all var _CHAR_ into x[colname=cNames];
close MBS4;
c = countn(x,"col");
cmiss = countmiss(x,"col");
/* combine results for num and char into a single table */
Names = cNames || nNames;
rNames = {" Missing", "Not Missing"};
cnt = (cmiss // c) || (nmiss // n);
print cnt[r=rNames c=Names label=""];
quit;
... View more