<?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 inputing many variables into proc iml in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/inputing-many-variables-into-proc-iml/m-p/231942#M2445</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose that I have a data of daily stock returns and I have many stocks, say 100. What I want to do is to input all of these stock returns into Proc IML in the following way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc IML;&lt;BR /&gt;use returns;&lt;BR /&gt;read all var {abc def .... zzz} into RMAT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So instead of individually typing inside the parentheses the names of the stocks, I would like to have a way that automatically inputs all the 100 names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the sake of SIMPLICITY consider this as my original data (having only 3 stocks) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; returns;&lt;/P&gt;
&lt;P&gt;input abc def zzz;&lt;/P&gt;
&lt;P&gt;datalines;&lt;/P&gt;
&lt;P&gt;10 2 5&lt;/P&gt;
&lt;P&gt;3 -5 7&lt;/P&gt;
&lt;P&gt;-1 -7 6&lt;/P&gt;
&lt;P&gt;1 3 -2&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what I would like to have is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Proc IML;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;use returns;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;read all var {abc def &amp;nbsp;zzz} into RMAT;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But the names should be input automatically and not typed one by one.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I tried doing {abc - zzz} but got an error message...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!!!&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2015 03:12:49 GMT</pubDate>
    <dc:creator>ilikesas</dc:creator>
    <dc:date>2015-10-28T03:12:49Z</dc:date>
    <item>
      <title>inputing many variables into proc iml</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/inputing-many-variables-into-proc-iml/m-p/231942#M2445</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose that I have a data of daily stock returns and I have many stocks, say 100. What I want to do is to input all of these stock returns into Proc IML in the following way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc IML;&lt;BR /&gt;use returns;&lt;BR /&gt;read all var {abc def .... zzz} into RMAT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So instead of individually typing inside the parentheses the names of the stocks, I would like to have a way that automatically inputs all the 100 names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the sake of SIMPLICITY consider this as my original data (having only 3 stocks) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; returns;&lt;/P&gt;
&lt;P&gt;input abc def zzz;&lt;/P&gt;
&lt;P&gt;datalines;&lt;/P&gt;
&lt;P&gt;10 2 5&lt;/P&gt;
&lt;P&gt;3 -5 7&lt;/P&gt;
&lt;P&gt;-1 -7 6&lt;/P&gt;
&lt;P&gt;1 3 -2&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what I would like to have is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Proc IML;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;use returns;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;read all var {abc def &amp;nbsp;zzz} into RMAT;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But the names should be input automatically and not typed one by one.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I tried doing {abc - zzz} but got an error message...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much!!!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 03:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/inputing-many-variables-into-proc-iml/m-p/231942#M2445</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2015-10-28T03:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: inputing many variables into proc iml</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/inputing-many-variables-into-proc-iml/m-p/231948#M2447</link>
      <description>&lt;P&gt;Here are two ways to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to read all the numeric variables from the input data set then use the syntax:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;use returns;
read all var _num_  into RMAT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or&amp;nbsp;if you&amp;nbsp;use a consistent system for naming&amp;nbsp;variables in the stock returns data set.&amp;nbsp; For example&amp;nbsp;use s1 s2 and s3 instead of abc def and zzz, then you can read the variables using the syntax:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;use returns;
read all var ('s1':'s3') into RMAT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Oct 2015 08:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/inputing-many-variables-into-proc-iml/m-p/231948#M2447</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2015-10-28T08:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: inputing many variables into proc iml</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/inputing-many-variables-into-proc-iml/m-p/231966#M2448</link>
      <description>&lt;P&gt;I agree with Ian. If you also want the names of the variables that you read, you can include the clause [colname=varNames] after the name of the matrix, like this:&lt;/P&gt;
&lt;P&gt;read all var _num_ into RMAT[colname=varNames];&lt;/P&gt;
&lt;P&gt;The varNames vector is a character vector that contains the name of the variables in the same order as the columns of RMAT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more details and examples, see 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;</description>
      <pubDate>Wed, 28 Oct 2015 11:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/inputing-many-variables-into-proc-iml/m-p/231966#M2448</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-10-28T11:45:57Z</dc:date>
    </item>
  </channel>
</rss>

