<?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: Retaining current value for next 10 days in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267875#M269358</link>
    <description>Thanks for your logic. It works fine with little modifications.</description>
    <pubDate>Tue, 03 May 2016 11:01:24 GMT</pubDate>
    <dc:creator>lakshmiG</dc:creator>
    <dc:date>2016-05-03T11:01:24Z</dc:date>
    <item>
      <title>Retaining current value for next 10 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267850#M269354</link>
      <description>&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, Thanks a lot!!! I have been getting wonderful response and solutions from members of this group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a query,&lt;/P&gt;&lt;P&gt;Please find my attached excel file, It has values for CE1, CE2, CE3, CE4, CE5. The requirement is, if CE4 = "+" then trigger Trend="UP" for next 10 days. whenever we encounter CE4="+" then we should trigger "UP" trend for next 10 days.&amp;nbsp; Please someone guide me how to achieve this in SAS?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 09:25:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267850#M269354</guid>
      <dc:creator>lakshmiG</dc:creator>
      <dc:date>2016-05-03T09:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining current value for next 10 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267858#M269355</link>
      <description>&lt;P&gt;What&amp;nbsp;&lt;SPAN&gt;current value you want to retain ? You also want operate it in each SYMBOL group ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile='/folders/myfolders/ce12345.xlsx' dbms=xlsx replace out=have;run;

data want;
 set have;
 by symbol;
 retain new_close _date;
 if first.symbol then call missing(new_close,_date);
 if ce4='+' then do;
  new_close=close;
  _date=date1;
 end;
 if date1 gt sum(_date,10)  then call missing(new_close);
 drop _date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 May 2016 09:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267858#M269355</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-05-03T09:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining current value for next 10 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267871#M269356</link>
      <description>&lt;P&gt;I have found a solution .Hope this works.&lt;BR /&gt;data inter;&lt;BR /&gt;set ce12345;&lt;BR /&gt;length trend $8.;&lt;BR /&gt;retain hhcnt;&lt;BR /&gt;if ce4="+" then do;&lt;BR /&gt;tr="UP4";&lt;BR /&gt;hhcnt=count;&lt;BR /&gt;end;&lt;BR /&gt;if hhcnt ne . and (count-hhcnt)&amp;lt;= 9 then tr="UP";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Please confirm.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 10:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267871#M269356</guid>
      <dc:creator>lakshmiG</dc:creator>
      <dc:date>2016-05-03T10:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining current value for next 10 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267872#M269357</link>
      <description>&lt;P&gt;Ksharp, Thanks a lot for your guidance. I need to retain the current "UP" value for the Trend column we are creating for the next 10 days whenever we encounter a "+" in the CE4 variable. And yes, for each symbol group. Just saw your answer. I will apply and test in my coding. Thanks!!!&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2016 10:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267872#M269357</guid>
      <dc:creator>lakshmiG</dc:creator>
      <dc:date>2016-05-03T10:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Retaining current value for next 10 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267875#M269358</link>
      <description>Thanks for your logic. It works fine with little modifications.</description>
      <pubDate>Tue, 03 May 2016 11:01:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Retaining-current-value-for-next-10-days/m-p/267875#M269358</guid>
      <dc:creator>lakshmiG</dc:creator>
      <dc:date>2016-05-03T11:01:24Z</dc:date>
    </item>
  </channel>
</rss>

