<?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: Fill in the blanks with the previous value in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109992#M30556</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys! I used Mit's and it worked like a charm! Sam yours also works! Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Oct 2013 14:06:03 GMT</pubDate>
    <dc:creator>sweetgorgor</dc:creator>
    <dc:date>2013-10-11T14:06:03Z</dc:date>
    <item>
      <title>Fill in the blanks with the previous value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109989#M30553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="186"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;Portfolio&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="43"&gt;Value&lt;/TD&gt;&lt;TD class="xl63" style="border-left: medium none;" width="79"&gt;New_Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-left: medium none; border-top: medium none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-left: medium none; border-top: medium none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt; &lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-left: medium none; border-top: medium none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt; &lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-left: medium none; border-top: medium none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: medium none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-left: medium none; border-top: medium none;"&gt; &lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-left: medium none; border-top: medium none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi, I have a table with the&amp;nbsp; first 2 columns (Portfolio, Value) where I want to create a 3rd column to fill in all the blanks with the previous (Latest value), by portfolio. Essentially I am trying to derive column 3. I tried to use Lag and retain in a data step I can't seem to get it to work. can someone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 21:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109989#M30553</guid>
      <dc:creator>sweetgorgor</dc:creator>
      <dc:date>2013-10-10T21:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in the blanks with the previous value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109990#M30554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;BR /&gt;input portfolio $ value;&lt;BR /&gt;cards;&lt;BR /&gt;A 2&lt;BR /&gt;A 3&lt;BR /&gt;A&amp;nbsp; &lt;BR /&gt;A&amp;nbsp; &lt;BR /&gt;B 2&lt;BR /&gt;B&amp;nbsp; &lt;BR /&gt;B&amp;nbsp; &lt;BR /&gt;B 4&lt;BR /&gt;B&amp;nbsp; &lt;BR /&gt;B&amp;nbsp; &lt;BR /&gt;,&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=have ;&lt;BR /&gt; by portfolio;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt; by portfolio;&lt;BR /&gt; retain new_value;&lt;BR /&gt; if not missing(value) then new_value=value;&lt;BR /&gt;run;&lt;/P&gt;&lt;TABLE border="0" cellpadding="2" cellspacing="0" width="191"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="19" width="35%"&gt;&lt;BR /&gt;&lt;P&gt;portfolio&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="23%"&gt;&lt;BR /&gt;&lt;P&gt;value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="42%"&gt;&lt;BR /&gt;&lt;P&gt;new_value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19" width="35%"&gt;&lt;BR /&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="23%"&gt;&lt;BR /&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="42%"&gt;&lt;BR /&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19" width="35%"&gt;&lt;BR /&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="23%"&gt;&lt;BR /&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="42%"&gt;&lt;BR /&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19" width="35%"&gt;&lt;BR /&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="23%"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="42%"&gt;&lt;BR /&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19" width="35%"&gt;&lt;BR /&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="23%"&gt;&lt;BR /&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="42%"&gt;&lt;BR /&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19" width="35%"&gt;&lt;BR /&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="23%"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="42%"&gt;&lt;BR /&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19" width="35%"&gt;&lt;BR /&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="23%"&gt;&lt;BR /&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="42%"&gt;&lt;BR /&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19" width="35%"&gt;&lt;BR /&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="23%"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD height="19" width="42%"&gt;&lt;BR /&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 23:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109990#M30554</guid>
      <dc:creator>Mit</dc:creator>
      <dc:date>2013-10-10T23:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in the blanks with the previous value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109991#M30555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another apporach, i used Mit Have dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; portfolio : &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;$1.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;A 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;A 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;A&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;A&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;B 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;B&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;B&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;B 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;B&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black; font-size: 10pt;"&gt;B&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;(last.portfolio);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; portfolio &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;notsorted&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; new_val=ifn(value ne &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;.&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;,value,new_val);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sam &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 02:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109991#M30555</guid>
      <dc:creator>sam369</dc:creator>
      <dc:date>2013-10-11T02:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Fill in the blanks with the previous value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109992#M30556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys! I used Mit's and it worked like a charm! Sam yours also works! Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Fill-in-the-blanks-with-the-previous-value/m-p/109992#M30556</guid>
      <dc:creator>sweetgorgor</dc:creator>
      <dc:date>2013-10-11T14:06:03Z</dc:date>
    </item>
  </channel>
</rss>

