<?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: sas merge left in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253413#M48223</link>
    <description>&lt;P&gt;sum amount at date (n), meaning accumulated?&lt;/P&gt;
&lt;P&gt;Sounds like report&amp;nbsp;to me, not a DB (or table/data set).&lt;/P&gt;
&lt;P&gt;Even if cubes aren't hot anymore, they can handle this kind summaries quite well, and allows for some kind of flexibility in the reporting.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2016 12:16:44 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-03-01T12:16:44Z</dc:date>
    <item>
      <title>sas merge left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253401#M48218</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have the following db:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Status client&amp;nbsp;(from&amp;nbsp;a to n) -character&lt;/P&gt;&lt;P&gt;Market (multiples) -character&lt;/P&gt;&lt;P&gt;id_client (multiple codes) -character&lt;/P&gt;&lt;P&gt;observation date (date from 1 to 3) -date&lt;/P&gt;&lt;P&gt;amount - numeric&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a DB where I can follow each client over time, i.e. a DB with the following variables&lt;/P&gt;&lt;P&gt;market, Id client, sum(amount at date1), sum(amount) at date2, sum(amount) at date 3, status of client at date1, status of client at date2, staus of client at date3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you suggest me a code that could work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AA&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 11:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253401#M48218</guid>
      <dc:creator>alessandra9010</dc:creator>
      <dc:date>2016-03-01T11:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: sas merge left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253413#M48223</link>
      <description>&lt;P&gt;sum amount at date (n), meaning accumulated?&lt;/P&gt;
&lt;P&gt;Sounds like report&amp;nbsp;to me, not a DB (or table/data set).&lt;/P&gt;
&lt;P&gt;Even if cubes aren't hot anymore, they can handle this kind summaries quite well, and allows for some kind of flexibility in the reporting.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 12:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253413#M48223</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-01T12:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: sas merge left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253430#M48229</link>
      <description>&lt;P&gt;Well, the output should be a dataset not a report.&lt;/P&gt;&lt;P&gt;Yes by sum amount at date (n) I mean accumulated amount at date n for each client, in each status in each market.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 13:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253430#M48229</guid>
      <dc:creator>alessandra9010</dc:creator>
      <dc:date>2016-03-01T13:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: sas merge left</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253460#M48236</link>
      <description>&lt;P&gt;Your update includes important information ... that each client/market/status gets totaled separately.&amp;nbsp; Here's one way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=have;&lt;/P&gt;
&lt;P&gt;by id_client market status date;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;by id_client market status;&lt;/P&gt;
&lt;P&gt;if first.status then tot_amount = amount;&lt;/P&gt;
&lt;P&gt;else tot_amount + amount;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree that this looks more like a report than a data set, but that's not for me to judge.&amp;nbsp; This should get you what you are asking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 15:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-merge-left/m-p/253460#M48236</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-03-01T15:09:13Z</dc:date>
    </item>
  </channel>
</rss>

