<?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: Lining up variables when exporting data to Excel from PROC IML in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234398#M54928</link>
    <description>&lt;P&gt;If PROC IML is not changing the order of the data, you would write the IML results into a SAS data set, and then merge with the original data set that contains N.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If IML is changing the order of the data, you'd need to include N in your IML matrices and sort/re-arrange N the same as you are doing with the rest of the data.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2015 15:47:23 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2015-11-12T15:47:23Z</dc:date>
    <item>
      <title>Lining up variables when exporting data to Excel from PROC IML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234395#M54927</link>
      <description>&lt;P&gt;I have a dataset in which three variables&amp;nbsp;(let's call them X, Y, and Z) are to be written into matrices in PROC IML and have some calculations performed upon them. The result of the calculations I need to export to an Excel file. Another column in the original dataset (let's call it N) will not be used in any calculations, but I need it written to the Excel spreadsheet alongside the output of the calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I ensure that the values in N line up with the corresponding results in the output? I suspect that a loop of some kind is needed (for every record in N, (write X, Y, and Z to matrices, perform the calculations, write N to Excel, write results to Excel)). Am I right about the loop? Is it possible to have several different steps within one loop? And what is the exact syntax for this?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 15:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234395#M54927</guid>
      <dc:creator>dvtarasov</dc:creator>
      <dc:date>2015-11-12T15:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Lining up variables when exporting data to Excel from PROC IML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234398#M54928</link>
      <description>&lt;P&gt;If PROC IML is not changing the order of the data, you would write the IML results into a SAS data set, and then merge with the original data set that contains N.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If IML is changing the order of the data, you'd need to include N in your IML matrices and sort/re-arrange N the same as you are doing with the rest of the data.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 15:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234398#M54928</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-11-12T15:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Lining up variables when exporting data to Excel from PROC IML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234402#M54931</link>
      <description>&lt;P&gt;Suppose&amp;nbsp;I now have a matrix with two columns (one read from N, the other&amp;nbsp;from X), and I need to multiply the matrix elementwise by the matrix&amp;nbsp;that was read from Y. What is the syntax for leaving the column in the first matrix that came from N unchanged?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 16:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234402#M54931</guid>
      <dc:creator>dvtarasov</dc:creator>
      <dc:date>2015-11-12T16:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lining up variables when exporting data to Excel from PROC IML</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234405#M54932</link>
      <description>&lt;P&gt;Assuming matrix X has variable X in column 1 and variable N in column 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;newcolumn=x[:,1]#y;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it sounds like there's really no reason to put X and N into the same matrix in IML.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 16:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Lining-up-variables-when-exporting-data-to-Excel-from-PROC-IML/m-p/234405#M54932</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-11-12T16:06:36Z</dc:date>
    </item>
  </channel>
</rss>

