<?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 number by &amp;quot;.&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754259#M237810</link>
    <description>Thank you !</description>
    <pubDate>Thu, 15 Jul 2021 10:00:51 GMT</pubDate>
    <dc:creator>Rodrigue</dc:creator>
    <dc:date>2021-07-15T10:00:51Z</dc:date>
    <item>
      <title>Replace number by "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754185#M237778</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a row (ImplantNYHA) with different values (0,1,2,3,4,99).&lt;/P&gt;&lt;P&gt;I would like to change the 0 and 99 values by "." and keep the 1, 2 , 3 and 4 as they are&lt;/P&gt;&lt;P&gt;I tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;data try; set ICDCRTdatabase;&lt;/P&gt;&lt;P&gt;if ImplantNYHA = 99 then ".";&lt;/P&gt;&lt;P&gt;if ImplantNYHA = 0 then ".";&lt;/P&gt;&lt;P&gt;then ImplantNYHA = ImplantNYHA;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;R&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Capture d’écran 2021-07-14 à 22.49.26.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61264i1E9A6BE965DEA561/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture d’écran 2021-07-14 à 22.49.26.png" alt="Capture d’écran 2021-07-14 à 22.49.26.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 20:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754185#M237778</guid>
      <dc:creator>Rodrigue</dc:creator>
      <dc:date>2021-07-14T20:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Replace number by "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754188#M237780</link>
      <description>&lt;P&gt;You need to make a valid assignment, and you can simplify the condition:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data try;
set ICDCRTdatabase;
if ImplantNYHA in (0,99) then ImplantNYHA = .;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jul 2021 20:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754188#M237780</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-14T20:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Replace number by "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754189#M237781</link>
      <description>&lt;P&gt;The variable name is missing and also your variable is Number not char. Use this:&lt;BR /&gt;&lt;BR /&gt;if ImplantNYHA in(0,99) then ImplantNYHA=.;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 21:05:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754189#M237781</guid>
      <dc:creator>Rydhm</dc:creator>
      <dc:date>2021-07-14T21:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Replace number by "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754190#M237782</link>
      <description>&lt;P&gt;Is your variable numeric or character?&lt;BR /&gt;&lt;BR /&gt;If it's character you need to use the quotes around the values, if it's numeric you do not. You use it on one part of the code and then not the other so not sure. SAS didn't error/warn on your comparison so I'm going to assume it's numeric. &lt;BR /&gt;&lt;BR /&gt;FYI you can also use the CALL MISSING() routine where it doesn't matter what the types are.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*for character values;
if imp1nyha in ('0', '99') then call missing(imp1nyha);
*for numeric values;
if imp1nyha in (0, 99) then call missing(imp1nyha);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jul 2021 21:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754190#M237782</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-14T21:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Replace number by "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754191#M237783</link>
      <description>It looks like it’s a numeric variable so you would not need the “”.</description>
      <pubDate>Wed, 14 Jul 2021 21:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754191#M237783</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-07-14T21:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Replace number by "."</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754259#M237810</link>
      <description>Thank you !</description>
      <pubDate>Thu, 15 Jul 2021 10:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-number-by-quot-quot/m-p/754259#M237810</guid>
      <dc:creator>Rodrigue</dc:creator>
      <dc:date>2021-07-15T10:00:51Z</dc:date>
    </item>
  </channel>
</rss>

