<?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: Data Step in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265170#M18397</link>
    <description>&lt;P&gt;Thanks mate. I figured it out..&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2016 17:28:21 GMT</pubDate>
    <dc:creator>jibyjacob</dc:creator>
    <dc:date>2016-04-20T17:28:21Z</dc:date>
    <item>
      <title>Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/264993#M18379</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on automating a process, this includes retrieving data from numerous outputs. I find the following a challenge and need your help. I need to sum up premiums on a monthly basis for the current month and I have macro variables that calculates current month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me create a datastep that sum up premiums for current month, in this scenario it is March 2016. there will a new variable for April 2016 next month ( EP201604).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example.&lt;/P&gt;&lt;P&gt;EP201601 EP201602 EP201603&lt;/P&gt;&lt;P&gt;545&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5454545&amp;nbsp;&amp;nbsp;&amp;nbsp; 5454545&lt;/P&gt;&lt;P&gt;4545&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5454545&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5454545&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 03:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/264993#M18379</guid>
      <dc:creator>jibyjacob</dc:creator>
      <dc:date>2016-04-20T03:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/264994#M18380</link>
      <description>&lt;P&gt;Please post what your current data looks like and what your output would look like.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 03:52:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/264994#M18380</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-20T03:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265015#M18384</link>
      <description>&lt;P&gt;It sounds like you need create a appropriate&amp;nbsp;macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let current=EP%sysfunc(today(),yymmn6.);
%let last=EP%sysfunc(intnx(month,%sysfunc(today()),-1),yymmn6.);

%put &amp;amp;current &amp;amp;last;

data want;
 set have;
  &amp;amp;current = &amp;amp;last ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Apr 2016 06:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265015#M18384</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-04-20T06:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265031#M18386</link>
      <description>&lt;P&gt;That dataset strcuture is not a good storage method from a programming point of view. &amp;nbsp;Work with normalised data, then transpose at the end, will make your life a lot easier. &amp;nbsp;Show your data too, as no idea why there would be two observations for each:&lt;/P&gt;
&lt;P&gt;Period &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Total&lt;/P&gt;
&lt;P&gt;EP201601 &amp;nbsp; 545&lt;/P&gt;
&lt;P&gt;EP201602 &amp;nbsp; &amp;nbsp;5454545&lt;/P&gt;
&lt;P&gt;EP201603 &amp;nbsp; &amp;nbsp;5454545&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is a far easier structure to work with.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 08:37:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265031#M18386</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-20T08:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265086#M18389</link>
      <description>&lt;P&gt;You mention that you have calculated a macro variable that indicates the current month ... but you don't show us what that looks like.&amp;nbsp; So I will take the easiest route, and assume that you have (or could create) the equivalent of:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let current = 201603;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And that your process would automatically change so that next time you would get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let current = 201604;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then summing the proper variable might be as simple as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have;&lt;/P&gt;
&lt;P&gt;var EP&amp;amp;current;&lt;/P&gt;
&lt;P&gt;output out=want sum=;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are probably some differences between this and what you actually are working with right now, but this would be the general idea of how to approach the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 13:10:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265086#M18389</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-20T13:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265170#M18397</link>
      <description>&lt;P&gt;Thanks mate. I figured it out..&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 17:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265170#M18397</guid>
      <dc:creator>jibyjacob</dc:creator>
      <dc:date>2016-04-20T17:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265171#M18398</link>
      <description>Thanks Mate</description>
      <pubDate>Wed, 20 Apr 2016 17:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265171#M18398</guid>
      <dc:creator>jibyjacob</dc:creator>
      <dc:date>2016-04-20T17:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265175#M18399</link>
      <description>Thank a lot..</description>
      <pubDate>Wed, 20 Apr 2016 17:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Data-Step/m-p/265175#M18399</guid>
      <dc:creator>jibyjacob</dc:creator>
      <dc:date>2016-04-20T17:37:29Z</dc:date>
    </item>
  </channel>
</rss>

