<?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 How to code for the consecutive values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227376#M40958</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I wonder if someone can help me to figure it out of how to write code for filling the consecutive values, as following:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 192pt;" border="0" width="256" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" width="64" /&gt; &lt;COL style="width: 48pt;" width="64" /&gt; &lt;COL style="width: 48pt;" span="2" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl68" style="height: 15.0pt; width: 48pt;"&gt;ID&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-left: none; width: 48pt;"&gt;VISIT&lt;/TD&gt;
&lt;TD width="64" class="xl68" style="border-left: none; width: 48pt;"&gt;VALUE&lt;/TD&gt;
&lt;TD width="64" class="xl68" style="border-left: none; width: 48pt;"&gt;WANTS&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;P&gt;ID A at visit 3, the value = 1, I want to fill the consecutive visits with the value as 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if my question is not clear enough.&lt;/P&gt;
&lt;P&gt;Thanks you very much in advance.&lt;/P&gt;</description>
    <pubDate>Sat, 26 Sep 2015 01:39:06 GMT</pubDate>
    <dc:creator>ursula</dc:creator>
    <dc:date>2015-09-26T01:39:06Z</dc:date>
    <item>
      <title>How to code for the consecutive values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227376#M40958</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I wonder if someone can help me to figure it out of how to write code for filling the consecutive values, as following:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 192pt;" border="0" width="256" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" width="64" /&gt; &lt;COL style="width: 48pt;" width="64" /&gt; &lt;COL style="width: 48pt;" span="2" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl68" style="height: 15.0pt; width: 48pt;"&gt;ID&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="border-left: none; width: 48pt;"&gt;VISIT&lt;/TD&gt;
&lt;TD width="64" class="xl68" style="border-left: none; width: 48pt;"&gt;VALUE&lt;/TD&gt;
&lt;TD width="64" class="xl68" style="border-left: none; width: 48pt;"&gt;WANTS&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;
&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;P&gt;ID A at visit 3, the value = 1, I want to fill the consecutive visits with the value as 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if my question is not clear enough.&lt;/P&gt;
&lt;P&gt;Thanks you very much in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2015 01:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227376#M40958</guid>
      <dc:creator>ursula</dc:creator>
      <dc:date>2015-09-26T01:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to code for the consecutive values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227377#M40959</link>
      <description>&lt;P&gt;BY-processing is perfect for this type of problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
retain WANTS;
set have; by ID;
if first.ID then WANTS = 0;
if &lt;FONT color="#FF0000"&gt;value&lt;/FONT&gt; then WANTS = 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edited, thanks to ballardw!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 18:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227377#M40959</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-09-28T18:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to code for the consecutive values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227529#M41010</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If Value then Wants=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I think.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 16:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227529#M41010</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-09-28T16:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to code for the consecutive values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227720#M41053</link>
      <description>&lt;P&gt;wow, it works!!&lt;/P&gt;
&lt;P&gt;Thanks so much!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 17:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227720#M41053</guid>
      <dc:creator>ursula</dc:creator>
      <dc:date>2015-09-29T17:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to code for the consecutive values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227721#M41054</link>
      <description>&lt;P&gt;Thanks, ballardw for updating the code.&lt;/P&gt;
&lt;P&gt;I appreciate your help!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 17:19:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-code-for-the-consecutive-values/m-p/227721#M41054</guid>
      <dc:creator>ursula</dc:creator>
      <dc:date>2015-09-29T17:19:38Z</dc:date>
    </item>
  </channel>
</rss>

