<?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: Replace missing values with 0 in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509799#M1830</link>
    <description>&lt;P&gt;Since visits contains the number of following columns, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data testing;
infile datalines missover dlm=',' dsd;
input id $ visits @;
do i = 1 to visits;
  input unitpurchased @;
  if unitpurchased = . then unitpurchased = 0;
  output;
end;
drop visits i;
datalines;
C005,3,15,,39
D2356,4,11,,,5
A323,3,10,15,20
F123,1,
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;Edit: added the dsd option.&lt;/EM&gt;&lt;/FONT&gt; &lt;/P&gt;</description>
    <pubDate>Fri, 02 Nov 2018 09:58:42 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-11-02T09:58:42Z</dc:date>
    <item>
      <title>Replace missing values with 0</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509795#M1827</link>
      <description>&lt;P&gt;Greetings all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following data set with some missing values. When I try to convert them into 0, however, most of them do not show up. How could I fix this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data testing;&lt;BR /&gt;infile datalines missover dlm=',';&lt;BR /&gt;input id $ visits unitpurchased @;&lt;BR /&gt;if unitpurchased=. then unitpurchased=0;&lt;BR /&gt;do while (unitpurchased ^=.);&lt;BR /&gt;output;&lt;BR /&gt;input unitpurchased @;&lt;BR /&gt;end;&lt;BR /&gt;drop visits;&lt;BR /&gt;datalines;&lt;BR /&gt;C005,3,15,,39&lt;BR /&gt;D2356,4,11,,,5&lt;BR /&gt;A323,3,10,15,20&lt;BR /&gt;F123,1,&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 09:30:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509795#M1827</guid>
      <dc:creator>blowsnow__</dc:creator>
      <dc:date>2018-11-02T09:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Replace missing values with 0</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509796#M1828</link>
      <description>&lt;P&gt;Before executing the code use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options missing=0;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Nov 2018 09:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509796#M1828</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-11-02T09:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Replace missing values with 0</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509797#M1829</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options missing=0;
data testing;
infile datalines missover dlm=',';
input id $ visits unitpurchased @;
datalines;
C005,3,15,,39
D2356,4,11,,,5
A323,3,10,15,20
F123,1,
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Nov 2018 09:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509797#M1829</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-11-02T09:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Replace missing values with 0</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509799#M1830</link>
      <description>&lt;P&gt;Since visits contains the number of following columns, do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data testing;
infile datalines missover dlm=',' dsd;
input id $ visits @;
do i = 1 to visits;
  input unitpurchased @;
  if unitpurchased = . then unitpurchased = 0;
  output;
end;
drop visits i;
datalines;
C005,3,15,,39
D2356,4,11,,,5
A323,3,10,15,20
F123,1,
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&lt;EM&gt;Edit: added the dsd option.&lt;/EM&gt;&lt;/FONT&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 09:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Replace-missing-values-with-0/m-p/509799#M1830</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-02T09:58:42Z</dc:date>
    </item>
  </channel>
</rss>

