<?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: Remplace missing value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347624#M80341</link>
    <description>&lt;P&gt;ok, with automatically, I take it that you mean that you always have the nonmissing value in the first observation? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set mydata;
	if _N_ = 1 then do;
		temp_mark = mark;
		temp_last = last;
		retain temp_mark temp_last;
	end;
	if missing(mark) then mark=temp_mark;
	if missing(last) then last = temp_last;

	drop temp_mark temp_last;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Apr 2017 08:23:22 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2017-04-06T08:23:22Z</dc:date>
    <item>
      <title>Remplace missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347615#M80333</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a large data set, look like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data mydata;&lt;BR /&gt;input id month mark last;&lt;BR /&gt;cards;&lt;BR /&gt;1 4 14.5 28&lt;BR /&gt;1 1 . .&lt;BR /&gt;1 3 . .&lt;BR /&gt;2 7 . .&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I want to remplace all missing value by 14.5 and 28, I mean like this&lt;/P&gt;&lt;P&gt;ID month mark&amp;nbsp;&amp;nbsp; last&lt;BR /&gt;1&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14.5&amp;nbsp;&amp;nbsp;&amp;nbsp; 28&lt;BR /&gt;1&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14.5&amp;nbsp;&amp;nbsp;&amp;nbsp; 28&lt;BR /&gt;1&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14.5&amp;nbsp;&amp;nbsp;&amp;nbsp; 28&lt;BR /&gt;1&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14.5&amp;nbsp;&amp;nbsp;&amp;nbsp; 28&lt;BR /&gt;2&amp;nbsp;&amp;nbsp; 7 &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; 14.5 &amp;nbsp;&amp;nbsp; 28&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 07:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347615#M80333</guid>
      <dc:creator>John4</dc:creator>
      <dc:date>2017-04-06T07:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Remplace missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347620#M80338</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
input id month mark last;
cards;
1 4 14.5 28
1 1 . .
1 3 . .
2 7 . .
;
run;

data want;
	set mydata;
	if missing(mark) then mark=14.5;
	if missing(last) then last = 28;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Apr 2017 08:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347620#M80338</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-04-06T08:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Remplace missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347621#M80339</link>
      <description>&lt;P&gt;Yes but since I have a large data set, I want to do it automatically&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 08:18:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347621#M80339</guid>
      <dc:creator>John4</dc:creator>
      <dc:date>2017-04-06T08:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Remplace missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347624#M80341</link>
      <description>&lt;P&gt;ok, with automatically, I take it that you mean that you always have the nonmissing value in the first observation? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set mydata;
	if _N_ = 1 then do;
		temp_mark = mark;
		temp_last = last;
		retain temp_mark temp_last;
	end;
	if missing(mark) then mark=temp_mark;
	if missing(last) then last = temp_last;

	drop temp_mark temp_last;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Apr 2017 08:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347624#M80341</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-04-06T08:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Remplace missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347626#M80342</link>
      <description>&lt;P&gt;Yes &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2017 08:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347626#M80342</guid>
      <dc:creator>John4</dc:creator>
      <dc:date>2017-04-06T08:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Remplace missing value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347690#M80376</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
input id month mark last;
cards;
1 4 14.5 28
1 1 . .
1 3 . .
2 7 . .
;
run;

data want;
	set mydata(drop= mark last);
 if _n_=1 then set mydata(keep= mark last obs=1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Apr 2017 13:03:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remplace-missing-value/m-p/347690#M80376</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-06T13:03:16Z</dc:date>
    </item>
  </channel>
</rss>

