<?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: Special missing value(s) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Special-missing-value-s/m-p/831765#M328736</link>
    <description>&lt;P&gt;If your answer variable is numerical then below will work and set any source string to missing that can't get converted to a numerical value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data survey;
  infile datalines truncover dsd dlm=' ';
   input id answer ?? :f16.;
   datalines;
001 2
002 #
003 1
004 #
005 2
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;btw: The term "special missings" means something else in the SAS world. It's how SAS stores missings in a numerical variable. It's not often used and only useful in conjunction with certain procedures.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Sep 2022 07:21:03 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2022-09-05T07:21:03Z</dc:date>
    <item>
      <title>Special missing value(s)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Special-missing-value-s/m-p/831760#M328733</link>
      <description>&lt;P&gt;Hello Everybody,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;having read the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lestmtsglobal/n0ewjmosjtyjbtn1t5zabfkrof4f.htm" target="_self"&gt;SAS Documentation of the MISSING Statement&lt;/A&gt;&amp;nbsp;,I wanted to replace the special charachter "#" (hash) in a numeric variable with the default value "." :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data survey;
   missing '#';
   input id answer;
   datalines;
001 2
002 #
003 1
004 #
005 2
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, I do get the following error:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR 36-169: '#' is an invalid special missing value. Only letters A through Z and _ can be used.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In my original data step I am using an&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/8.1/lestmtsref/n1rill4udj0tfun1fvce3j401plo.htm" target="_self"&gt;infile statement with the missover option&lt;/A&gt;&amp;nbsp;, but there I cannot "tell" SAS what sort of missing value, i.e. "#", it has to interpret.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another more complicating fact to it, is the possibilty that the representation of the missing value in the data which has to be read in can be varying, i.e. "#" or "##" or "##(blank)##".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The most elegant way which I am looking for, is to tell the infile statement the special characters, that represent a missing value.&lt;/P&gt;
&lt;P&gt;Otherwise, I can only see a solution along the lines of using if...then... else if...&amp;nbsp; constructs or using an select statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me out?&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 07:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Special-missing-value-s/m-p/831760#M328733</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2022-09-05T07:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Special missing value(s)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Special-missing-value-s/m-p/831765#M328736</link>
      <description>&lt;P&gt;If your answer variable is numerical then below will work and set any source string to missing that can't get converted to a numerical value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data survey;
  infile datalines truncover dsd dlm=' ';
   input id answer ?? :f16.;
   datalines;
001 2
002 #
003 1
004 #
005 2
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;btw: The term "special missings" means something else in the SAS world. It's how SAS stores missings in a numerical variable. It's not often used and only useful in conjunction with certain procedures.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 07:21:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Special-missing-value-s/m-p/831765#M328736</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-09-05T07:21:03Z</dc:date>
    </item>
  </channel>
</rss>

