<?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: Every month update an excel file with new monthly information in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421459#M103684</link>
    <description>&lt;P&gt;Let's do it most simple.&lt;/P&gt;&lt;P&gt;The excel DEC input data includes one columnn&lt;/P&gt;</description>
    <pubDate>Fri, 15 Dec 2017 08:56:20 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2017-12-15T08:56:20Z</dc:date>
    <item>
      <title>Every month update an excel file with new monthly information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421455#M103682</link>
      <description>&lt;P&gt;Dear friends&lt;/P&gt;&lt;P&gt;I have the following request.&lt;/P&gt;&lt;P&gt;I have an excel file that conatins monthly outputs in same sheet (output from Jan2017 until Nov2017)&lt;/P&gt;&lt;P&gt;This file was creates manually by copy and paste SAS output from input excel file that I receive every month.&lt;/P&gt;&lt;P&gt;The challenge now is to perform automatics process that includes following steps:&lt;/P&gt;&lt;P&gt;Import monthly excel raw data into SAS&lt;/P&gt;&lt;P&gt;Create analysis on this file with summary statistics output&lt;/P&gt;&lt;P&gt;Import&amp;nbsp; into&amp;nbsp;&amp;nbsp;SAS the cumulative output excel file that contains information from JAN2017 until Previous month&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add the new&amp;nbsp;&lt;SPAN&gt;summary statistics information to&amp;nbsp;&amp;nbsp;cumulative output excel file&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Export&amp;nbsp; the updated&amp;nbsp;&amp;nbsp;cumulative output&amp;nbsp; to excel file&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I will explain it now in more details:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Step1-&lt;/P&gt;&lt;P&gt;Every month I will receive an excel file(let’s call it input file) with data on it.&lt;/P&gt;&lt;P&gt;I need to import the excel file into sas data set and perform calculations in order to get output file.&lt;/P&gt;&lt;P&gt;This output file information includes for example 1 column.&lt;/P&gt;&lt;P&gt;Let’s say that the last month of analysis was DEC2017&lt;/P&gt;&lt;P&gt;Step2-&lt;/P&gt;&lt;P&gt;There is existing cumulative periods excel file that includes ouputs from Jan2017 until &amp;nbsp;NOV2017&lt;/P&gt;&lt;P&gt;I need to import this file and add a column with results of&amp;nbsp; DEC2017&lt;/P&gt;&lt;P&gt;Step3-&lt;/P&gt;&lt;P&gt;Export &amp;nbsp;the updated cumulative periods excel file that includes now months JAN2017-DEC2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May someone send an easy example &amp;nbsp;code&amp;nbsp; how to do it&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 08:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421455#M103682</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2017-12-15T08:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Every month update an excel file with new monthly information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421457#M103683</link>
      <description>&lt;P&gt;2 things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- So your attatched Excel file is your desired output? What does the input data look like? Provide a sample.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- It is rarely a good idea to have &lt;SPAN&gt;dynamic columns, ie. columns that represent eg time. Instead, transpose your data so you have&amp;nbsp;four columns: Month, Total sales, Total Costs and Net.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 08:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421457#M103683</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-12-15T08:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Every month update an excel file with new monthly information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421459#M103684</link>
      <description>&lt;P&gt;Let's do it most simple.&lt;/P&gt;&lt;P&gt;The excel DEC input data includes one columnn&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 08:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421459#M103684</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2017-12-15T08:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Every month update an excel file with new monthly information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421460#M103685</link>
      <description>&lt;P&gt;The question is :&lt;/P&gt;&lt;P&gt;How to import SAS results into existing excel file&lt;/P&gt;&lt;P&gt;How to tell SAS to paste the export in a new column and not override the&amp;nbsp; existing columns for previous months&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 08:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421460#M103685</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2017-12-15T08:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Every month update an excel file with new monthly information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421462#M103687</link>
      <description>&lt;P&gt;Well first off, let me start by saying Excel is the corenerstone of every bad process in existence.&amp;nbsp; If you insist on using that as a data medium be prepared to debug and alter your code&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;every time&lt;/STRONG&gt;&lt;/U&gt; you run the code.&amp;nbsp; You will find this out when you start, there are so many "features" that will trip up your code, or user changes that will mess with the code.&amp;nbsp; But anyways, you wont listen, but you will find out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The easiest way to do what you say below is to use XLSX format and libname xlsx:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/05/20/using-libname-xlsx-to-read-and-write-excel-files/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2015/05/20/using-libname-xlsx-to-read-and-write-excel-files/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this you can proc copy data in and out, i.e. take all data from the xlsx, do your code, then write the data back again.&amp;nbsp; Very simple.&amp;nbsp; Any other solution will end up being far more work than this, trust me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 09:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421462#M103687</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-15T09:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Every month update an excel file with new monthly information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421634#M103705</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Dear friends&lt;/P&gt;
&lt;P&gt;I have the following request.&lt;/P&gt;
&lt;P&gt;I have an excel file that conatins monthly outputs in same sheet (output from Jan2017 until Nov2017)&lt;/P&gt;
&lt;P&gt;This file was creates manually by copy and paste SAS output from input excel file that I receive every month.&lt;/P&gt;
&lt;P&gt;The challenge now is to perform automatics process that includes following steps:&lt;/P&gt;
&lt;P&gt;Import monthly excel raw data into SAS&lt;/P&gt;
&lt;P&gt;Create analysis on this file with summary statistics output&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff0000"&gt;Import&amp;nbsp; into&amp;nbsp;&amp;nbsp;SAS the cumulative output excel file that contains information from JAN2017 until Previous month&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Add the new&amp;nbsp;&lt;SPAN&gt;summary statistics information to&amp;nbsp;&amp;nbsp;cumulative output excel file&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Export&amp;nbsp; the updated&amp;nbsp;&amp;nbsp;cumulative output&amp;nbsp; to excel file&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The line I highlighted in red is really a major flaw in the process. Create output and then read it back in? Is there something being done to that data manually. If so you don't say. Keep the original data in SAS, append the new data in an appropriate format, and recreate the output - all of if.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The major bit of reimporting is that I have seen too many Excel files where people start putting formula and undocumented manual changes. If you have actual manual changes that need to be done then formally establish the process and UPDATE existing data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A single data set with all of the data would then make it very easy for the time someone wants to look at a three year set, Or some other interval such as July to June of the next year.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 16:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421634#M103705</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-15T16:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Every month update an excel file with new monthly information</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421753#M103721</link>
      <description>&lt;P&gt;Thank you so so much&lt;/P&gt;&lt;P&gt;It is a great solution I think.&lt;/P&gt;&lt;P&gt;Just to be sure about the step.&lt;/P&gt;&lt;P&gt;step1- Import exiting excel output file (Let's&amp;nbsp; call it&amp;nbsp; data set A)&lt;/P&gt;&lt;P&gt;Step2-&amp;nbsp;Do your code on current month in order to produce new summary statsitics for current month&lt;SPAN&gt;&amp;nbsp;(Let's&amp;nbsp; call it&amp;nbsp; data set b)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Step3- Merge&amp;nbsp; data set A and B&lt;/P&gt;&lt;P&gt;IS it correct??&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>Sat, 16 Dec 2017 07:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Every-month-update-an-excel-file-with-new-monthly-information/m-p/421753#M103721</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2017-12-16T07:08:31Z</dc:date>
    </item>
  </channel>
</rss>

