<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic proc iml for counting missing values for all variables in a dataset. in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879300#M5998</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Jun 2023 02:29:32 GMT</pubDate>
    <dc:creator>Wub_SAS</dc:creator>
    <dc:date>2023-06-06T02:29:32Z</dc:date>
    <item>
      <title>proc iml for counting missing values for all variables in a dataset.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879300#M5998</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Jun 2023 02:29:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879300#M5998</guid>
      <dc:creator>Wub_SAS</dc:creator>
      <dc:date>2023-06-06T02:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc iml for counting missing values for all variables in a dataset.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879305#M5999</link>
      <description>&lt;P&gt;Use PROC FREQ for this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
tables _all_ / missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;From this, play around with output datasets (OUTPUT statement or OUTPUT= option of TABLES).&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 07:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879305#M5999</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-06-06T07:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: proc iml for counting missing values for all variables in a dataset.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879323#M6000</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Why not post it at IML forum? since it is about IML.
https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/bd-p/sas_iml
*/
data MBS4;
 set sashelp.heart;
run;
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 = t(cNames || nNames);
rNames = {"    Missing", "Not Missing"};
cnt = (cmiss`//nmiss`) || (c` // n`);
print cnt[r=Names c=rNames label=""]; 
quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1686051735734.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/84746i3BAC7A2C075886F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1686051735734.png" alt="Ksharp_0-1686051735734.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 11:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879323#M6000</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-06-06T11:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc iml for counting missing values for all variables in a dataset.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879368#M6001</link>
      <description>&lt;P&gt;An alternate:&lt;/P&gt;
&lt;PRE&gt;proc format;
value m
. = 'Missing'
other='Not missing'
;
value $m
'',' '='Missing'
other='Not missing'
;
run;

proc tabulate data=sashelp.heart;
   class _all_ /missing;
   classlev _all_/ style=[just=r];
   format _numeric_ m. _character_ $m.;
   table _all_,
         n 
   ;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Jun 2023 14:55:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879368#M6001</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-06-06T14:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: proc iml for counting missing values for all variables in a dataset.</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879695#M6002</link>
      <description>&lt;P&gt;Thank you All!! All of these are working well. I just went with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s as it gave me more compact table.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 06:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/proc-iml-for-counting-missing-values-for-all-variables-in-a/m-p/879695#M6002</guid>
      <dc:creator>Wub_SAS</dc:creator>
      <dc:date>2023-06-08T06:29:03Z</dc:date>
    </item>
  </channel>
</rss>

