<?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 Update consecutive values based on criteria in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Update-consecutive-values-based-on-criteria/m-p/691474#M24823</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T;
input ID L EXP;
Datalines;
1 1 10
1 2 10
1 2 20
1 3 30
2 1 10
2 1 10
2 2 60
3 2 60
3 3 60
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would to like to update Exp to 0 if for First.ID and L&amp;gt;1 for all instances of this ID (the sorting is done) i.e. the output should be&lt;/P&gt;
&lt;P&gt;1 1 10&lt;BR /&gt;1 2 10&lt;BR /&gt;1 2 20&lt;BR /&gt;1 3 30&lt;BR /&gt;2 1 10&lt;BR /&gt;2 1 10&lt;BR /&gt;2 2 60&lt;BR /&gt;3 2 0&lt;BR /&gt;3 3 0&lt;BR /&gt;;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Oct 2020 09:03:26 GMT</pubDate>
    <dc:creator>cmemtsa</dc:creator>
    <dc:date>2020-10-14T09:03:26Z</dc:date>
    <item>
      <title>Update consecutive values based on criteria</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Update-consecutive-values-based-on-criteria/m-p/691474#M24823</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T;
input ID L EXP;
Datalines;
1 1 10
1 2 10
1 2 20
1 3 30
2 1 10
2 1 10
2 2 60
3 2 60
3 3 60
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I would to like to update Exp to 0 if for First.ID and L&amp;gt;1 for all instances of this ID (the sorting is done) i.e. the output should be&lt;/P&gt;
&lt;P&gt;1 1 10&lt;BR /&gt;1 2 10&lt;BR /&gt;1 2 20&lt;BR /&gt;1 3 30&lt;BR /&gt;2 1 10&lt;BR /&gt;2 1 10&lt;BR /&gt;2 2 60&lt;BR /&gt;3 2 0&lt;BR /&gt;3 3 0&lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 09:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Update-consecutive-values-based-on-criteria/m-p/691474#M24823</guid>
      <dc:creator>cmemtsa</dc:creator>
      <dc:date>2020-10-14T09:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Update consecutive values based on criteria</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Update-consecutive-values-based-on-criteria/m-p/691483#M24824</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T;
input ID L EXP;
Datalines;
1 1 10
1 2 10
1 2 20
1 3 30
2 1 10
2 1 10
2 2 60
3 2 60
3 3 60
;
data want;
 do until(last.id);
  set t;
  by id;
  if l&amp;lt;=1 then flag=1;
 end;

 do until(last.id);
  set t;
  by id;
  if not flag then exp=0;
  output;
 end;
 drop flag;
 run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Oct 2020 09:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Update-consecutive-values-based-on-criteria/m-p/691483#M24824</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-14T09:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update consecutive values based on criteria</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Update-consecutive-values-based-on-criteria/m-p/691495#M24825</link>
      <description>&lt;P&gt;Thank you! It works.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 10:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Update-consecutive-values-based-on-criteria/m-p/691495#M24825</guid>
      <dc:creator>cmemtsa</dc:creator>
      <dc:date>2020-10-14T10:26:45Z</dc:date>
    </item>
  </channel>
</rss>

