<?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: Decimal shown in error log does not seem to exist. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883783#M349162</link>
    <description>&lt;P&gt;the data had strange characters in it. This fixed it: Longitude =Compress(tranwrd(Longitude,'0A'x,' '),,'kw')&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2023 17:35:23 GMT</pubDate>
    <dc:creator>KRusso</dc:creator>
    <dc:date>2023-07-06T17:35:23Z</dc:date>
    <item>
      <title>Decimal shown in error log does not seem to exist.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883756#M349154</link>
      <description>&lt;P&gt;I have a table with Latitude and Longitude saved in character format.&amp;nbsp; When I run this code I get this&amp;nbsp;note:&lt;/P&gt;&lt;P&gt;Invalid numeric data, Longitude='-80.192798.' , at line 65 column 20.&lt;/P&gt;&lt;DIV&gt;However, when I look at the table, none of the records contain that second decimal at the end.&lt;/DIV&gt;&lt;DIV&gt;I've used the scan, find, compress, count to eliminate this mystery decimal at the end. But these functions do not recognize it either.&lt;/DIV&gt;&lt;DIV&gt;The data that originally created the dataset was in MS Access. When data was imported, there were no errors.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;data agenttable;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;set agenttableFromaccess (keep =&amp;nbsp; Agent Latitude Longitude);&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; FORMAT LAT LNG BEST12.;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LAT=LATITUDE; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LNG=Longitude;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Jul 2023 16:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883756#M349154</guid>
      <dc:creator>KRusso</dc:creator>
      <dc:date>2023-07-06T16:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal shown in error log does not seem to exist.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883762#M349156</link>
      <description>&lt;P&gt;Whenever you encounter ERRORs or WARNINGs, post the&amp;nbsp;&lt;EM&gt;complete&lt;/EM&gt; (all code and messages) log of the failing step by copy/pasting it into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Longitude is a character variable containing something which prevents automatic conversion to numeric. Display it with a $HEX format of sufficient length to see which characters are contained.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 16:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883762#M349156</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-07-06T16:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal shown in error log does not seem to exist.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883764#M349157</link>
      <description>&lt;P&gt;Numbers can only contain one decimal point.&lt;/P&gt;
&lt;PRE&gt;'-80.192798.'&lt;/PRE&gt;
&lt;P&gt;has two decimal points.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 16:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883764#M349157</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-06T16:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal shown in error log does not seem to exist.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883765#M349158</link>
      <description>That isn't how you convert a character variable to a numeric one. You need to use INPUT to convert it.&lt;BR /&gt;&lt;BR /&gt;lat = input(latitude, best32.);&lt;BR /&gt;lng = input(longitude, best32.);&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Jul 2023 16:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883765#M349158</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-07-06T16:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal shown in error log does not seem to exist.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883783#M349162</link>
      <description>&lt;P&gt;the data had strange characters in it. This fixed it: Longitude =Compress(tranwrd(Longitude,'0A'x,' '),,'kw')&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 17:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883783#M349162</guid>
      <dc:creator>KRusso</dc:creator>
      <dc:date>2023-07-06T17:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal shown in error log does not seem to exist.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883792#M349164</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21945"&gt;@KRusso&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;the data had strange characters in it. This fixed it: Longitude =Compress(tranwrd(Longitude,'0A'x,' '),,'kw')&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So what is the goal of those function calls?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You convert the linefeed into a space.&amp;nbsp; Then you eliminated all of the non-printable characters, even the linefeeds you just remove.&amp;nbsp; So why not just remove the TRANWRD() function call?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or did you mean to convert non-breaking spaces ('A0'X) to spaces first?&amp;nbsp; That character will NOT be removed by COMPRESS() as apparently COMPRESS() thinks it IS a printable character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why not just keep the digits and other characters used to represent numbers?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;lng=input(compress(longitude,'+-.E','kd'),32.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2023 18:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Decimal-shown-in-error-log-does-not-seem-to-exist/m-p/883792#M349164</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-06T18:10:44Z</dc:date>
    </item>
  </channel>
</rss>

