<?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: Without missing statement why do numeric variables accept one character value? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397853#M96185</link>
    <description>&lt;P&gt;It does not work for me.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data x;
   input a d;
   cards;
1 2
A D
3 4
;   

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
                                 Obs    a    d

                                  1     1    2
                                  2     .    .
                                  3     3    4
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Sep 2017 18:02:08 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2017-09-21T18:02:08Z</dc:date>
    <item>
      <title>Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397848#M96183</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I encountered a problem that I couldn't understand. I have a sas program to read a file into sas, which contains number fields that have single character values as missing value. In my program, I didnt' specify "missing A D; " statement,&amp;nbsp;but the&amp;nbsp;program read&amp;nbsp;the value of 'A', and 'D', and create a sas dataset with the value of 'A', 'D', there is no errro message in the log file.&amp;nbsp; I am using SAS 9.4. I am just wondering if SAS 9.4 automatically convert character value for numeric field as missing value or not. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Xiumei&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 17:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397848#M96183</guid>
      <dc:creator>yangx</dc:creator>
      <dc:date>2017-09-21T17:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397853#M96185</link>
      <description>&lt;P&gt;It does not work for me.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data x;
   input a d;
   cards;
1 2
A D
3 4
;   

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
                                 Obs    a    d

                                  1     1    2
                                  2     .    .
                                  3     3    4
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Sep 2017 18:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397853#M96185</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-09-21T18:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397854#M96186</link>
      <description>&lt;P&gt;Almost certainly, your new variable is character not numeric.&amp;nbsp; You can run a PROC CONTENTS to find out.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 18:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397854#M96186</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-21T18:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397857#M96187</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for your prompt reply. But the variable is number, not character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Xiumei&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 18:08:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397857#M96187</guid>
      <dc:creator>yangx</dc:creator>
      <dc:date>2017-09-21T18:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397860#M96188</link>
      <description>&lt;P&gt;There are various places that the MISSING option can be specified:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lesysoptsref/69799/HTML/default/viewer.htm#n0qamf3yfjtwzhn1ran6xwblnlea.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lesysoptsref/69799/HTML/default/viewer.htm#n0qamf3yfjtwzhn1ran6xwblnlea.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you checked them all?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It wouldn't hurt to post the log from your DATA step.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 18:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397860#M96188</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-21T18:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397862#M96190</link>
      <description>&lt;P&gt;When reading a &lt;U&gt;text&lt;/U&gt; file (not a dataset) SAS does not convert character data into special missing values, unless you use the &lt;STRONG&gt;missing&lt;/STRONG&gt; statement. It will however convert character data into normal missing values without generating an error message if the ?? modifier is used&amp;nbsp;in conjunction with the informat in the &lt;STRONG&gt;input&lt;/STRONG&gt; statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 18:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397862#M96190</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-09-21T18:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397877#M96191</link>
      <description>&lt;P&gt;You should provide a sample of the data file and exactly how you read it into SAS.&lt;/P&gt;
&lt;P&gt;Post the code and example data into a code box opened with the forum {i} menu icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you see values of A and D then it is most likely that the variable is not actually numeric but character. The exception would be if you were reading data using a custom informat that assigns special missing values of .A .D or similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
invalue someinput
1 - 10=_same_
"A" = .A
"D" = .D
;
run;

data example;
   informat x someinput.;
   input x;
datalines;
1
2
A
3
D
4
5
;
run;
&lt;/PRE&gt;
&lt;P&gt;If you look at the data in a SAS table viewer you will see A and D for a numeric variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But:&lt;/P&gt;
&lt;PRE&gt;proc freq data=example;
run;&lt;/PRE&gt;
&lt;P&gt;Shows the values are missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 18:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397877#M96191</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-21T18:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397883#M96192</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for all the replies, but please see my program below, and data file has been attached.&lt;/P&gt;&lt;P&gt;filename data1 'try.txt';&lt;BR /&gt;data data1;&lt;BR /&gt;&amp;nbsp; infile data1 LRECL=4096 dlm='|' missover dsd;&lt;BR /&gt;&amp;nbsp; informat pcr98&amp;nbsp;&amp;nbsp;&amp;nbsp; $CHAR32. ;&lt;BR /&gt;&amp;nbsp; input ID&amp;nbsp; glucose3&amp;nbsp; tchol3&amp;nbsp; hdl3&amp;nbsp; ldl3&amp;nbsp; trig3&amp;nbsp; pcr98 $ ;&lt;BR /&gt;&amp;nbsp; label ID="participant id number"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; glucose3="Glucose"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tchol3="Total cholesterol"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hdl3="HDL"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldl3="LDL"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trig3="Triglycerides"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pcr98="completed by:";&lt;BR /&gt;run;&lt;BR /&gt;proc print data=data1;&lt;BR /&gt;run;&lt;BR /&gt;proc contents data=data1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;The variables here glucode3, tchol3, hdl3, ldl3 are all number fields, but in the data file, there are values of ".D", ".U".&amp;nbsp;&amp;nbsp;Without specifying "MISSING" statement, sas reads these value into the dataset. When I use proc freq, these values&amp;nbsp;are considered as missing values. My qestion is why SAS didn't give any error messages in the log file. thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;xiumei&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397883#M96192</guid>
      <dc:creator>yangx</dc:creator>
      <dc:date>2017-09-21T19:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397891#M96195</link>
      <description>&lt;P&gt;Now it becomes clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your data doesn't contain A and D.&amp;nbsp; It contains .A and .D instead, which SAS understands as numeric.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397891#M96195</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-21T19:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397894#M96197</link>
      <description>&lt;P&gt;Sorry, I don't understand, why does sas understand ".A", ".D" as numeric? then how about ".NA"? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Xiumei&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397894#M96197</guid>
      <dc:creator>yangx</dc:creator>
      <dc:date>2017-09-21T19:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397895#M96198</link>
      <description>&lt;P&gt;Because .D and .U are missing values in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any .A-.Z is considered missing by default and SAS treats data that's in that format as missing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397895#M96198</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-21T19:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397897#M96199</link>
      <description>&lt;P&gt;Astounding is correct. &amp;nbsp;Compare what you asked (line 2 of the data) with what you did (line 1 of the data).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data x;
   input a d;
   cards;
.A .D
A D
3 4
;   

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;                                Obs    a    d

                                  1     A    D
                                  2     .    .
                                  3     3    4
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397897#M96199</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-09-21T19:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397901#M96201</link>
      <description>&lt;P&gt;There are 28 missing values: .A - .Z and . and also ._&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.NA is not defined. &amp;nbsp;The MISSING statement is used to read A-Z and _ as numeric missing values.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:19:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397901#M96201</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-09-21T19:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397904#M96202</link>
      <description>&lt;P&gt;Here's the SAS documentation chapters on MISSING.&lt;/P&gt;
&lt;P&gt;It's worth a read:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n1il1j711miuhrn1tp0pldybc6zq.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/69852/HTML/default/viewer.htm#n1il1j711miuhrn1tp0pldybc6zq.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397904#M96202</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-21T19:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Without missing statement why do numeric variables accept one character value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397907#M96204</link>
      <description>&lt;P&gt;Thanks for the reply. Now I understand for .A-.Z, ._, no need to specify "MISSING" statement in SAS program, sas will consider these values&amp;nbsp;as missing, but for A-Z, MISSING statement need to specified delibrately&amp;nbsp;in sas program, such as MISSING A D. Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Xiumei&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 19:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Without-missing-statement-why-do-numeric-variables-accept-one/m-p/397907#M96204</guid>
      <dc:creator>yangx</dc:creator>
      <dc:date>2017-09-21T19:29:16Z</dc:date>
    </item>
  </channel>
</rss>

