<?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 How to select a column by its name in PROC IML process? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246073#M268573</link>
    <description>&lt;P&gt;Hello to whomever can help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set like following:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1617iC4DF3E506D1A5E7A/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;I tried the following program, but it give me error.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IML;
        print (mu_vec['MSFT']);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;error message is like following. Please help. Thank you.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1618iAECA97CF62EB72FF/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2016 09:59:30 GMT</pubDate>
    <dc:creator>BingL</dc:creator>
    <dc:date>2016-01-26T09:59:30Z</dc:date>
    <item>
      <title>How to select a column by its name in PROC IML process?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246073#M268573</link>
      <description>&lt;P&gt;Hello to whomever can help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set like following:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1617iC4DF3E506D1A5E7A/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt;I tried the following program, but it give me error.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IML;
        print (mu_vec['MSFT']);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;error message is like following. Please help. Thank you.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1618iAECA97CF62EB72FF/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 09:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246073#M268573</guid>
      <dc:creator>BingL</dc:creator>
      <dc:date>2016-01-26T09:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to select a column by its name in PROC IML process?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246186#M268574</link>
      <description>&lt;P&gt;First you have to read the data from the data set into a matrix or vector.&lt;/P&gt;
&lt;P&gt;Read the article &lt;A href="http://blogs.sas.com/content/iml/2012/01/16/reading-all-variables-into-a-matrix.html" target="_self"&gt;"Reading ALL variables INTO a matrix."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the data in a data set that has one observation and three variables?&amp;nbsp; If so, then the PROC IML statements look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
use Have;
read all var {"MSFT" "NORD" "SBUX"} into mu_vec;
close Have;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to read all of the numeric variables, you can use this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;read all var _NUM_ into mu_vec[colname=varNames];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2016 18:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246186#M268574</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-26T18:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to select a column by its name in PROC IML process?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246192#M268575</link>
      <description>Hello Rick&lt;BR /&gt;&lt;BR /&gt;Thank you for your response and help.&lt;BR /&gt;&lt;BR /&gt;Data was create in PROC IML procedure.&lt;BR /&gt;&lt;BR /&gt;It is like following code:&lt;BR /&gt;&lt;BR /&gt;names = {'MSFT' 'NORD' 'SBUX'};&lt;BR /&gt;mattrib mu_vec c=names;&lt;BR /&gt;&lt;BR /&gt;actually I haven't tried the following.&lt;BR /&gt;&lt;BR /&gt;mu_vec[, 'MSFT'];</description>
      <pubDate>Tue, 26 Jan 2016 19:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246192#M268575</guid>
      <dc:creator>BingL</dc:creator>
      <dc:date>2016-01-26T19:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to select a column by its name in PROC IML process?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246193#M268576</link>
      <description>&lt;P&gt;If you are using a column name attribute, you need to specify the name as a column:&lt;BR /&gt;mu_vec[, 'MSFT'];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more information and examples, see&lt;A href="http://blogs.sas.com/content/iml/2012/10/01/access-rows-or-columns-of-a-matrix-by-names.html" target="_self"&gt; "Access rows or columns of a matrix by names."&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 19:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-select-a-column-by-its-name-in-PROC-IML-process/m-p/246193#M268576</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-01-26T19:09:38Z</dc:date>
    </item>
  </channel>
</rss>

