<?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: missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341296#M78090</link>
    <description>&lt;P&gt;Assuming that I understand what you want, here's one way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data defaults;&lt;/P&gt;
&lt;P&gt;set test1 (keep=id amt);&lt;/P&gt;
&lt;P&gt;by id;&lt;/P&gt;
&lt;P&gt;where amt &amp;gt; .;&lt;/P&gt;
&lt;P&gt;if first.id;&lt;/P&gt;
&lt;P&gt;rename amt=default_amt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge test1 defaults;&lt;/P&gt;
&lt;P&gt;by id;&lt;/P&gt;
&lt;P&gt;if amt &amp;gt; . then default_amt = amt;&lt;/P&gt;
&lt;P&gt;else amt = default_amt;&lt;/P&gt;
&lt;P&gt;drop default_amt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's untested, but looks like it should work just fine.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Mar 2017 18:40:23 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-03-15T18:40:23Z</dc:date>
    <item>
      <title>missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341287#M78089</link>
      <description>&lt;P&gt;data input;&lt;BR /&gt;input ID $ period amt;&lt;BR /&gt;cards;&lt;BR /&gt;X 201001 10000&lt;BR /&gt;X 201004 800&lt;BR /&gt;X 201006 200&lt;BR /&gt;Y 201101 100&lt;BR /&gt;Y 201102 100&lt;BR /&gt;Z 201201 .&lt;BR /&gt;Z 201202 .&lt;BR /&gt;Z 201203 .&lt;/P&gt;&lt;P&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 10:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341287#M78089</guid>
      <dc:creator>sascodequestion</dc:creator>
      <dc:date>2017-03-16T10:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341296#M78090</link>
      <description>&lt;P&gt;Assuming that I understand what you want, here's one way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data defaults;&lt;/P&gt;
&lt;P&gt;set test1 (keep=id amt);&lt;/P&gt;
&lt;P&gt;by id;&lt;/P&gt;
&lt;P&gt;where amt &amp;gt; .;&lt;/P&gt;
&lt;P&gt;if first.id;&lt;/P&gt;
&lt;P&gt;rename amt=default_amt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge test1 defaults;&lt;/P&gt;
&lt;P&gt;by id;&lt;/P&gt;
&lt;P&gt;if amt &amp;gt; . then default_amt = amt;&lt;/P&gt;
&lt;P&gt;else amt = default_amt;&lt;/P&gt;
&lt;P&gt;drop default_amt;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's untested, but looks like it should work just fine.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 18:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341296#M78090</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-15T18:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341308#M78093</link>
      <description>&lt;P&gt;Please repost your orginial question or a close version.&lt;/P&gt;
&lt;P&gt;Without the question the response makes no sense.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341308#M78093</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-15T19:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341418#M78136</link>
      <description>&lt;PRE&gt;


data input;
input ID $ period amt;
cards;
X 201001 10000
X 201004 800
X 201006 200
Y 201101 100
Y 201102 100
Z 201201 .
Z 201202 .
Z 201203 .
;
run;
data want;
 merge input input(keep=id period 
 rename=(id=_id period=_period) firstobs=2);
 output;
 if id=_id then do;
  do i=period+1 to _period-1;
   period=i;output;
  end;
 end;
 drop _: i;
run;

&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Mar 2017 04:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/missing-values/m-p/341418#M78136</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-16T04:47:38Z</dc:date>
    </item>
  </channel>
</rss>

