<?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 Export to XLSX file and add a new column every month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753552#M237526</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Lets say that every month I need to run SAS code that calculate number of customers in each city.&lt;/P&gt;
&lt;P&gt;Let's say that I start run this report today (July 2021) and the data for July 2021 is :&lt;/P&gt;
&lt;P&gt;City&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Nr_customers2107&lt;/P&gt;
&lt;P&gt;London&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;250&lt;/P&gt;
&lt;P&gt;New Castle&amp;nbsp; 300&lt;/P&gt;
&lt;P&gt;Machester&amp;nbsp; &amp;nbsp;180&lt;/P&gt;
&lt;P&gt;Then I want to export it into one XLSX file called "Customers_by_month" with one sheet called "Output".&lt;/P&gt;
&lt;P&gt;Next month (Aug 2021) I will run the same report and lets say the data will be :&lt;/P&gt;
&lt;P&gt;London&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;220&lt;/P&gt;
&lt;P&gt;New Castle&amp;nbsp; 250&lt;/P&gt;
&lt;P&gt;Machester&amp;nbsp; &amp;nbsp;200&lt;/P&gt;
&lt;P&gt;Then I want to export this data into same XLSX file and add a new column called "Nr_customers2108"&lt;/P&gt;
&lt;P&gt;and so on every month.&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;P&gt;The task is to export to one XLX file (one sheet) and each month export to same XLSA file and add a new column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jul 2021 17:11:27 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-07-12T17:11:27Z</dc:date>
    <item>
      <title>Export to XLSX file and add a new column every month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753552#M237526</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Lets say that every month I need to run SAS code that calculate number of customers in each city.&lt;/P&gt;
&lt;P&gt;Let's say that I start run this report today (July 2021) and the data for July 2021 is :&lt;/P&gt;
&lt;P&gt;City&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Nr_customers2107&lt;/P&gt;
&lt;P&gt;London&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;250&lt;/P&gt;
&lt;P&gt;New Castle&amp;nbsp; 300&lt;/P&gt;
&lt;P&gt;Machester&amp;nbsp; &amp;nbsp;180&lt;/P&gt;
&lt;P&gt;Then I want to export it into one XLSX file called "Customers_by_month" with one sheet called "Output".&lt;/P&gt;
&lt;P&gt;Next month (Aug 2021) I will run the same report and lets say the data will be :&lt;/P&gt;
&lt;P&gt;London&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;220&lt;/P&gt;
&lt;P&gt;New Castle&amp;nbsp; 250&lt;/P&gt;
&lt;P&gt;Machester&amp;nbsp; &amp;nbsp;200&lt;/P&gt;
&lt;P&gt;Then I want to export this data into same XLSX file and add a new column called "Nr_customers2108"&lt;/P&gt;
&lt;P&gt;and so on every month.&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;P&gt;The task is to export to one XLX file (one sheet) and each month export to same XLSA file and add a new column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 17:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753552#M237526</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-07-12T17:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Export to XLSX file and add a new column every month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753583#M237542</link>
      <description>I think you need to use macro variables for the months. You can use proc export to send it XLSX.</description>
      <pubDate>Mon, 12 Jul 2021 18:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753583#M237542</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-07-12T18:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Export to XLSX file and add a new column every month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753584#M237543</link>
      <description>&lt;P&gt;Use ODS EXCEL and PROC REPORT to create the wide report from the long dataset; use the month variable as ACROSS.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 18:52:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753584#M237543</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-12T18:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Export to XLSX file and add a new column every month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753588#M237546</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Use ODS EXCEL and PROC REPORT to create the wide report from the long dataset; use the month variable as ACROSS.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Which would overwrite the existing report, not add a column.&lt;/P&gt;
&lt;P&gt;My approach as well when first reading the request. Then I started thinking about a "partial" input data set that doesn't contain all the data for all the columns as a possible use by the OP. Which would not have all the columns.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 19:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-to-XLSX-file-and-add-a-new-column-every-month/m-p/753588#M237546</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-12T19:09:46Z</dc:date>
    </item>
  </channel>
</rss>

