<?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 Splitting a set of positive &amp;amp; increasing values-growth, from the fluctuating values (same variable) in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500494#M354</link>
    <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone&amp;nbsp;help me how to sort this attached sample financial accounting data in SAS 9.4 or SAS Studio (the real data could be few hundred thousands obs).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to the SAS file as i could not attach here:&amp;nbsp;&lt;A href="https://1drv.ms/f/s!AhVkgVJPuTkWh03K4IT_COxuKZwP" target="_blank"&gt;https://1drv.ms/f/s!AhVkgVJPuTkWh03K4IT_COxuKZwP&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let EPSFIQ be&amp;nbsp;the representative of earnings of the firm 1690. I want to see how many times over the sample period the firm 1690 has consecutively reported earnings more than last quarter, and by 'consecutive' i expect the firm should have reported earnings more than last quarter 5 consecutive times for the earnings string to be considered as consecutive. So this period of 5 consecutive increased earnings can be called an earnings string. In other words, the condition for such strings is 5 consecutive increases in EPSFIQ.&lt;/P&gt;&lt;P&gt;I want to separate such earnings strings from the rest of the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Updated)&lt;/P&gt;&lt;P&gt;Thanks in advance for your time.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Oct 2018 14:06:15 GMT</pubDate>
    <dc:creator>hasnat</dc:creator>
    <dc:date>2018-10-02T14:06:15Z</dc:date>
    <item>
      <title>Splitting a set of positive &amp; increasing values-growth, from the fluctuating values (same variable)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500494#M354</link>
      <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone&amp;nbsp;help me how to sort this attached sample financial accounting data in SAS 9.4 or SAS Studio (the real data could be few hundred thousands obs).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to the SAS file as i could not attach here:&amp;nbsp;&lt;A href="https://1drv.ms/f/s!AhVkgVJPuTkWh03K4IT_COxuKZwP" target="_blank"&gt;https://1drv.ms/f/s!AhVkgVJPuTkWh03K4IT_COxuKZwP&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let EPSFIQ be&amp;nbsp;the representative of earnings of the firm 1690. I want to see how many times over the sample period the firm 1690 has consecutively reported earnings more than last quarter, and by 'consecutive' i expect the firm should have reported earnings more than last quarter 5 consecutive times for the earnings string to be considered as consecutive. So this period of 5 consecutive increased earnings can be called an earnings string. In other words, the condition for such strings is 5 consecutive increases in EPSFIQ.&lt;/P&gt;&lt;P&gt;I want to separate such earnings strings from the rest of the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Updated)&lt;/P&gt;&lt;P&gt;Thanks in advance for your time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 14:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500494#M354</guid>
      <dc:creator>hasnat</dc:creator>
      <dc:date>2018-10-02T14:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a set of positive &amp; increasing values-growth, from the fluctuating values (same va</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500714#M388</link>
      <description>&lt;P&gt;hi Hasnat,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not 100% sure I understand the requirement, but if I am correct, you can use the below and specify the output in the proc report by 'key'... I hope this helps...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=SASxyz; by FYYYYQ;&lt;BR /&gt;data SASxyz1;&lt;BR /&gt;set SASxyz;&lt;BR /&gt;counter = _N_;&lt;BR /&gt;Key = ceil(counter/5);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=SASxyz1 out=SASxyz2 (drop=_break_) nowd missing;&lt;BR /&gt;columns Key FYYYYQ EPSFIQ;&lt;BR /&gt;define Key/group;&lt;BR /&gt;define FYYYYQ/display;&lt;BR /&gt;define EPSFIQ/display;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output sample:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Key&lt;/TD&gt;&lt;TD&gt;FYYYYQ&lt;/TD&gt;&lt;TD&gt;EPSFIQ&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1980.099976&lt;/TD&gt;&lt;TD&gt;0.06&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1980.199951&lt;/TD&gt;&lt;TD&gt;0.06&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1980.300049&lt;/TD&gt;&lt;TD&gt;0.06&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1980.400024&lt;/TD&gt;&lt;TD&gt;0.07&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD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0.4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Marlene&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 12:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500714#M388</guid>
      <dc:creator>Mar1ene</dc:creator>
      <dc:date>2018-10-02T12:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a set of positive &amp; increasing values-growth, from the fluctuating values (same va</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500748#M392</link>
      <description>&lt;P&gt;Hi. Thanks for your help and feedback. I ran your code and edited a bit but realized that description of the post was indeed not sufficient, I have elaborated further.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 14:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500748#M392</guid>
      <dc:creator>hasnat</dc:creator>
      <dc:date>2018-10-02T14:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a set of positive &amp; increasing values-growth, from the fluctuating values (same va</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500833#M413</link>
      <description>&lt;P&gt;Hi Hasnat,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I give up... LOL!&amp;nbsp; Guess the pro's should rather assist.&amp;nbsp; Give my below code a shot...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=SASxyz; by FYYYYQ;&lt;BR /&gt;data SASxyz1 (drop=prev_EPSFIQ move_perc);&lt;BR /&gt;set SASxyz;&lt;BR /&gt;by FYYYYQ;&lt;BR /&gt;format prev_EPSFIQ 8.2 move_perc comma5.2;&lt;BR /&gt;prev_EPSFIQ = lag(EPSFIQ);&lt;BR /&gt;if prev_EPSFIQ in (.,0) then prev_EPSFIQ=EPSFIQ;&lt;BR /&gt;move_perc = ((EPSFIQ-prev_EPSFIQ)/prev_EPSFIQ)*100;&lt;BR /&gt;count + 1;&lt;BR /&gt;if move_perc&amp;lt;0 then count = 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=SASxyz1 out=SASxyz2 (drop=_break_) nowd missing;&lt;BR /&gt;columns FYYYYQ count n;&lt;BR /&gt;define FYYYYQ/display;&lt;BR /&gt;define count/across;&lt;BR /&gt;where count ne 0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Go well!!&lt;/P&gt;&lt;P&gt;Marlene&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 16:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/500833#M413</guid>
      <dc:creator>Mar1ene</dc:creator>
      <dc:date>2018-10-02T16:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splitting a set of positive &amp; increasing values-growth, from the fluctuating values (same va</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/501199#M470</link>
      <description>&lt;P&gt;Hi Marlene!&lt;/P&gt;&lt;P&gt;Yes today my course coordinator spent a couple of hours&amp;nbsp;and came up with desired results, your 'if' statement idea was incorporated. Once i do it myself, i would update here as well as i did not explicitly seek teacher's permission to share the code.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 16:10:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Splitting-a-set-of-positive-amp-increasing-values-growth-from/m-p/501199#M470</guid>
      <dc:creator>hasnat</dc:creator>
      <dc:date>2018-10-03T16:10:56Z</dc:date>
    </item>
  </channel>
</rss>

