<?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 Questions in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-Questions/m-p/340063#M3337</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have recently been researching ways to come up with some basic statistics for the variable data in my datasets.&amp;nbsp; I found code that works well for me in &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;A href="http://blogs.sas.com/content/iml/2011/09/19/count-the-number-of-missing-values-for-each-variable.html" target="_blank"&gt;THIS &lt;/A&gt;&lt;/STRONG&gt;&lt;/FONT&gt;article by Rick Wicklin using proc iml.&amp;nbsp; I had some questions about his code but he is referring questions to this forum.&amp;nbsp; I want to take the following code that he used as an example in the blog and modify it to only pull back the variables I need.&amp;nbsp; Currently, it pulls back the statistics for all variables in the dataset.&amp;nbsp; I also am confused on how I would then export this to a dataset.&amp;nbsp; Could someone point me in the right direction on both of these questions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
use work.datagapanalysis;
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 work.datagapanalysis;
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;</description>
    <pubDate>Fri, 10 Mar 2017 19:07:39 GMT</pubDate>
    <dc:creator>elwayfan446</dc:creator>
    <dc:date>2017-03-10T19:07:39Z</dc:date>
    <item>
      <title>PROC IML Questions</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-Questions/m-p/340063#M3337</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have recently been researching ways to come up with some basic statistics for the variable data in my datasets.&amp;nbsp; I found code that works well for me in &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;A href="http://blogs.sas.com/content/iml/2011/09/19/count-the-number-of-missing-values-for-each-variable.html" target="_blank"&gt;THIS &lt;/A&gt;&lt;/STRONG&gt;&lt;/FONT&gt;article by Rick Wicklin using proc iml.&amp;nbsp; I had some questions about his code but he is referring questions to this forum.&amp;nbsp; I want to take the following code that he used as an example in the blog and modify it to only pull back the variables I need.&amp;nbsp; Currently, it pulls back the statistics for all variables in the dataset.&amp;nbsp; I also am confused on how I would then export this to a dataset.&amp;nbsp; Could someone point me in the right direction on both of these questions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
use work.datagapanalysis;
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 work.datagapanalysis;
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;</description>
      <pubDate>Fri, 10 Mar 2017 19:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-Questions/m-p/340063#M3337</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2017-03-10T19:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML Questions</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-Questions/m-p/340072#M3338</link>
      <description>&lt;P&gt;Instead of&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;read all &lt;SPAN class="token keyword"&gt;var&lt;/SPAN&gt; _NUM_ &lt;SPAN class="token keyword"&gt;into&lt;/SPAN&gt; x&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;colname&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;nNames&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;use&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;nNames = {"var1" "var2" "var3"};&lt;BR /&gt;read all &lt;SPAN class="token keyword"&gt;var&lt;/SPAN&gt; nNames &lt;SPAN class="token keyword"&gt;into&lt;/SPAN&gt; x&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Similarly, use&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;cNames = {"othervar1" "othervar2"};&lt;BR /&gt;read all &lt;SPAN class="token keyword"&gt;var&lt;/SPAN&gt; cNames &lt;SPAN class="token keyword"&gt;into&lt;/SPAN&gt; x&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;After you have formed the 'cnt' matrix, use the techniques in the article &lt;A href="http://blogs.sas.com/content/iml/2011/04/18/writing-data-from-a-matrix-to-a-sas-data-set.html" target="_self"&gt;http://blogs.sas.com/content/iml/2011/04/18/writing-data-from-a-matrix-to-a-sas-data-set.html&lt;/A&gt;"Writing data from a matrix to a SAS data set."&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 19:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-Questions/m-p/340072#M3338</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-03-10T19:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: PROC IML Questions</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-Questions/m-p/340077#M3339</link>
      <description>&lt;P&gt;Thank you Rick.&amp;nbsp; I will give this a try!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2017 19:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/PROC-IML-Questions/m-p/340077#M3339</guid>
      <dc:creator>elwayfan446</dc:creator>
      <dc:date>2017-03-10T19:32:10Z</dc:date>
    </item>
  </channel>
</rss>

