<?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 Re: calculate number of missing values for each variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calculate-number-of-missing-values-for-each-variable/m-p/978906#M378698</link>
    <description>&lt;P&gt;So it seems to me your real question is how to save the PROC IML results as actual SAS data sets. It would be desirable if you helped other users, and changed the title to reflect the real question you are asking.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IML has commands such as CREATE and APPEND to create actual SAS data sets from your results. Please see&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/imlug/imlug_langref_sect097.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/imlug/imlug_langref_sect097.htm&lt;/A&gt;&amp;nbsp;for many examples.&lt;/P&gt;</description>
    <pubDate>Sun, 16 Nov 2025 11:48:47 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2025-11-16T11:48:47Z</dc:date>
    <item>
      <title>calculate number of missing values for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-number-of-missing-values-for-each-variable/m-p/978902#M378696</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to calculate number of missing values for each variable in data set (numeric/Char).&lt;/P&gt;
&lt;P&gt;I saw this code.(SAS/IML language)&lt;/P&gt;
&lt;P&gt;I want to ask-&lt;/P&gt;
&lt;P&gt;How can I calculate it only for Make='Audi'&amp;nbsp; ?(I found solution using&amp;nbsp;(Where=(Make='Audi')) so i think it is fine)&lt;/P&gt;
&lt;P&gt;How can I export result into a data set?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
use sashelp.cars(Where=(Make='Audi'));
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 sashelp.cars;
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=""];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Nov 2025 07:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-number-of-missing-values-for-each-variable/m-p/978902#M378696</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-11-16T07:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: calculate number of missing values for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-number-of-missing-values-for-each-variable/m-p/978905#M378697</link>
      <description>&lt;P&gt;You should post it at IML forum, since it is relative to SAS/IML module.&lt;/P&gt;
&lt;P&gt;Anyway, here is what you are looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc iml;
use sashelp.cars(Where=(Make='Audi'));
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 sashelp.cars;
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=""];*/

&lt;STRONG&gt;create want from cnt[r=rNames c=Names];
append from cnt[r=rNames];
close;&lt;/STRONG&gt;
quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Nov 2025 11:34:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-number-of-missing-values-for-each-variable/m-p/978905#M378697</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-16T11:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: calculate number of missing values for each variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calculate-number-of-missing-values-for-each-variable/m-p/978906#M378698</link>
      <description>&lt;P&gt;So it seems to me your real question is how to save the PROC IML results as actual SAS data sets. It would be desirable if you helped other users, and changed the title to reflect the real question you are asking.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IML has commands such as CREATE and APPEND to create actual SAS data sets from your results. Please see&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/imlug/imlug_langref_sect097.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/imlug/imlug_langref_sect097.htm&lt;/A&gt;&amp;nbsp;for many examples.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Nov 2025 11:48:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calculate-number-of-missing-values-for-each-variable/m-p/978906#M378698</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-11-16T11:48:47Z</dc:date>
    </item>
  </channel>
</rss>

