<?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: Getting next non missing value for the same variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87387#M24936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe your example is oversimplified... but this would do it :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have(keep=x);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if not endy &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; then set have(keep=y where=(y is not missing)) end=endy;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; else call missing(y);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Sep 2013 22:20:51 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2013-09-18T22:20:51Z</dc:date>
    <item>
      <title>Getting next non missing value for the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87386#M24935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question for getting the next non missing value for the same variable, in other words I'm trying to move up the non missing values so my missing value will be at the bottom of the variable. Below table is the example that I'm trying to create, how can I do that with SAS procedure ?&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" width="64"&gt;X&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="64"&gt;Y&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="64"&gt;Y_New&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 21:56:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87386#M24935</guid>
      <dc:creator>Sas_R</dc:creator>
      <dc:date>2013-09-18T21:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Getting next non missing value for the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87387#M24936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe your example is oversimplified... but this would do it :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have(keep=x);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if not endy &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; then set have(keep=y where=(y is not missing)) end=endy;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; else call missing(y);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 22:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87387#M24936</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-09-18T22:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Getting next non missing value for the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87388#M24937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with simple steps;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data in ;&lt;BR /&gt;input x y;&lt;BR /&gt;ord=_n_;&lt;BR /&gt;cards;&lt;BR /&gt;1 .&lt;BR /&gt;2 . &lt;BR /&gt;3 7 &lt;BR /&gt;4 6&lt;BR /&gt;5 7&lt;BR /&gt;6 .&lt;BR /&gt;7 0&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data y;&lt;BR /&gt;set in (keep=y where=(y^=.));&lt;BR /&gt;ord=_n_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data&amp;nbsp; out;&lt;BR /&gt;merge in (drop=y) y;&lt;BR /&gt;by ord;&lt;BR /&gt;drop ord;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2013 05:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87388#M24937</guid>
      <dc:creator>Amarnath7</dc:creator>
      <dc:date>2013-09-19T05:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Getting next non missing value for the same variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87389#M24938</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;Im not sure the result, in which scenario do you really want.. here is the simple code using many to many merge..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input x y ;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 5&lt;/P&gt;&lt;P&gt;2 .&lt;/P&gt;&lt;P&gt;3 7&lt;/P&gt;&lt;P&gt;4 6&lt;/P&gt;&lt;P&gt;5 .&lt;/P&gt;&lt;P&gt;6 .&lt;/P&gt;&lt;P&gt;7 3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = have;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;merge have(keep = x) have(keep = y where = (y is not missing));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Yash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2013 11:22:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Getting-next-non-missing-value-for-the-same-variable/m-p/87389#M24938</guid>
      <dc:creator>yaswanthj</dc:creator>
      <dc:date>2013-09-19T11:22:30Z</dc:date>
    </item>
  </channel>
</rss>

