<?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: How do I validate an invalid numeric data error? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563580#M158016</link>
    <description>&lt;P&gt;After trying your suggestion, the error message comes back as this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Invalid data for temp in line 22 54-57.
NOTE: Invalid data for hum in line 22 64-67.
NOTE: Invalid data for pressure in line 22 71-76.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 04 Jun 2019 18:00:48 GMT</pubDate>
    <dc:creator>jenni_kang</dc:creator>
    <dc:date>2019-06-04T18:00:48Z</dc:date>
    <item>
      <title>How do I validate an invalid numeric data error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563574#M158010</link>
      <description>&lt;P&gt;Hello experts!&lt;/P&gt;&lt;P&gt;I am unsure as to the reason why there is a note of invalid numeric, (shown below)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Invalid numeric data, temp='20.2' , at line 1306 column 8.
NOTE: Invalid numeric data, hum='47.3' , at line 1307 column 7.
NOTE: Invalid numeric data, pressure='1002.3' , at line 1308 column &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but the value temp= '20.2' is the one I want to be outputted.&lt;/P&gt;&lt;P&gt;This is a sample of what I have.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	informat no best32. 
          date ddmmyy10. 
          time time20.3 
		  negmin best32. 
          negavg best32. 
          negmax best32. 
          posmin best32. 
          posavg best32. 
          posmax best32. 
          state best32.
          temp $6. 
          tempunit $2. 
          hum $6. 
          pressure $8. ;
         format no best12. 
         date ddmmyy10. 
         time time20.3 
         negmin best12. 
         negavg best12. 
         negmax best12. 
         posmin best12. 
         posavg best12. 
         posmax best12. 
         state best12.
         temp $6. 
         tempunit $2. 
         hum $6. 
         pressure $8. ;
      input
                  no
				  date
				  time
				  negmin
				  negavg
				  negmax
				  posmin
				  posavg
				  posmax
				  state
				  temp
				  tempunit
				  hum
				  pressure
      ;
      if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
      run;
data work.class1;
set work.class;
tempc= temp/10 ;
hump= hum/10  ;
press= pressure/10 ;

drop tempunit temp hum pressure;

datetime = dhms(date,0,0,0)+time;
format datetime datetime15.;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How do I get the correct output?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563574#M158010</guid>
      <dc:creator>jenni_kang</dc:creator>
      <dc:date>2019-06-04T17:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I validate an invalid numeric data error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563578#M158014</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276676"&gt;@jenni_kang&lt;/a&gt; replace this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;         temp $6. 
         hum $6. 
         pressure $8.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;         temp 8. 
         hum 8. 
         pressure 8.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563578#M158014</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-06-04T17:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I validate an invalid numeric data error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563579#M158015</link>
      <description>&lt;P&gt;Likely it would help to post the LOG with ALL of the code along with all of the notes and such that is generating the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since column positions may be important make sure to paste log into a code box opened with the forum's {I} or "running man" icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The INFILE statement has a lot of interaction with how things are read and is important to include when reading external data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Though I do wonder why you are reading those variables as CHARACTER&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;temp $6. 
hum $6. 
pressure $8. 
&lt;/PRE&gt;
&lt;P&gt;when you want to do arithmetic with them:&lt;/P&gt;
&lt;PRE&gt;tempc= temp/10 ;
hump= hum/10  ;
press= pressure/10 ;
&lt;/PRE&gt;
&lt;P&gt;I suspect if you remove the $ from informat for those variables the problem goes away...&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 17:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563579#M158015</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-04T17:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I validate an invalid numeric data error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563580#M158016</link>
      <description>&lt;P&gt;After trying your suggestion, the error message comes back as this&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Invalid data for temp in line 22 54-57.
NOTE: Invalid data for hum in line 22 64-67.
NOTE: Invalid data for pressure in line 22 71-76.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Jun 2019 18:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563580#M158016</guid>
      <dc:creator>jenni_kang</dc:creator>
      <dc:date>2019-06-04T18:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I validate an invalid numeric data error?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563581#M158017</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276676"&gt;@jenni_kang&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;After trying your suggestion, the error message comes back as this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Invalid data for temp in line 22 54-57.
NOTE: Invalid data for hum in line 22 64-67.
NOTE: Invalid data for pressure in line 22 71-76.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The log will also show the actual value of line 22 so you can see exactly what is columns 54 to 76 and why they don't work as numbers. Without that it is hard to give good advice for how to handle those cases.&amp;nbsp; It might be as simple as ignoring the error because it is clear that the text on that lines means that those numbers were not recorded.&amp;nbsp; For example if you generated that text from R it might but NA for missing values. So having TEMP be missing for line 22 is what you want to happen.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 18:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-validate-an-invalid-numeric-data-error/m-p/563581#M158017</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-04T18:06:22Z</dc:date>
    </item>
  </channel>
</rss>

