<?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 Carry forward the same value to end in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Carry-forward-the-same-value-to-end/m-p/14967#M63</link>
    <description>Hi I've data like following.&lt;BR /&gt;
custnbr mob bal&lt;BR /&gt;
A 0 1&lt;BR /&gt;
A 1 1&lt;BR /&gt;
A 2 1&lt;BR /&gt;
A 3 1&lt;BR /&gt;
A 4 0&lt;BR /&gt;
A 5 0&lt;BR /&gt;
A 6 0&lt;BR /&gt;
A 7 1&lt;BR /&gt;
A 8 0&lt;BR /&gt;
B 0 0&lt;BR /&gt;
B 1 0&lt;BR /&gt;
B 2 0&lt;BR /&gt;
B 3 0&lt;BR /&gt;
B 4 1&lt;BR /&gt;
B 5 1&lt;BR /&gt;
B 6 1&lt;BR /&gt;
B 7 0&lt;BR /&gt;
&lt;BR /&gt;
i need result like following.&lt;BR /&gt;
&lt;BR /&gt;
A 0 1&lt;BR /&gt;
A 1 1&lt;BR /&gt;
A 2 1&lt;BR /&gt;
A 3 1&lt;BR /&gt;
A 4 1&lt;BR /&gt;
A 5 1&lt;BR /&gt;
A 6 1&lt;BR /&gt;
A 7 1&lt;BR /&gt;
A 8 1&lt;BR /&gt;
B 0 0&lt;BR /&gt;
B 1 0&lt;BR /&gt;
B 2 0&lt;BR /&gt;
B 3 0&lt;BR /&gt;
B 4 1&lt;BR /&gt;
B 5 1&lt;BR /&gt;
B 6 1&lt;BR /&gt;
B 7 1&lt;BR /&gt;
&lt;BR /&gt;
basically the value when the record starts Bal = 1 then the same value should carry till end for the same customer.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
    <pubDate>Wed, 11 Nov 2009 04:44:30 GMT</pubDate>
    <dc:creator>Alankar</dc:creator>
    <dc:date>2009-11-11T04:44:30Z</dc:date>
    <item>
      <title>Carry forward the same value to end</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Carry-forward-the-same-value-to-end/m-p/14967#M63</link>
      <description>Hi I've data like following.&lt;BR /&gt;
custnbr mob bal&lt;BR /&gt;
A 0 1&lt;BR /&gt;
A 1 1&lt;BR /&gt;
A 2 1&lt;BR /&gt;
A 3 1&lt;BR /&gt;
A 4 0&lt;BR /&gt;
A 5 0&lt;BR /&gt;
A 6 0&lt;BR /&gt;
A 7 1&lt;BR /&gt;
A 8 0&lt;BR /&gt;
B 0 0&lt;BR /&gt;
B 1 0&lt;BR /&gt;
B 2 0&lt;BR /&gt;
B 3 0&lt;BR /&gt;
B 4 1&lt;BR /&gt;
B 5 1&lt;BR /&gt;
B 6 1&lt;BR /&gt;
B 7 0&lt;BR /&gt;
&lt;BR /&gt;
i need result like following.&lt;BR /&gt;
&lt;BR /&gt;
A 0 1&lt;BR /&gt;
A 1 1&lt;BR /&gt;
A 2 1&lt;BR /&gt;
A 3 1&lt;BR /&gt;
A 4 1&lt;BR /&gt;
A 5 1&lt;BR /&gt;
A 6 1&lt;BR /&gt;
A 7 1&lt;BR /&gt;
A 8 1&lt;BR /&gt;
B 0 0&lt;BR /&gt;
B 1 0&lt;BR /&gt;
B 2 0&lt;BR /&gt;
B 3 0&lt;BR /&gt;
B 4 1&lt;BR /&gt;
B 5 1&lt;BR /&gt;
B 6 1&lt;BR /&gt;
B 7 1&lt;BR /&gt;
&lt;BR /&gt;
basically the value when the record starts Bal = 1 then the same value should carry till end for the same customer.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Wed, 11 Nov 2009 04:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Carry-forward-the-same-value-to-end/m-p/14967#M63</guid>
      <dc:creator>Alankar</dc:creator>
      <dc:date>2009-11-11T04:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Carry forward the same value to end</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Carry-forward-the-same-value-to-end/m-p/14968#M64</link>
      <description>In a DATA step and using your SORTed file, you can use a temporary SAS variable (look up the RETAIN stmt) to test-for and capture the IF FIRST.CUSTNBR condition, and then assign the variable BAL to whatever is desired.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
DATA Step Processing&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001281588.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001281588.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
BY-Group Processing in the DATA Step  (FIRST.&lt;VARNAME&gt; is discussed here):&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001283274.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001283274.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Understanding the SAS® DATA Step and the Program Data Vector&lt;BR /&gt;
Steven First, Systems Seminar Consultants, Madison, WI&lt;BR /&gt;
&lt;A href="http://support.sas.com/resources/papers/proceedings09/136-2009.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings09/136-2009.pdf&lt;/A&gt;&lt;/VARNAME&gt;</description>
      <pubDate>Wed, 11 Nov 2009 14:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Carry-forward-the-same-value-to-end/m-p/14968#M64</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-11-11T14:16:02Z</dc:date>
    </item>
  </channel>
</rss>

