<?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: Conversion from Character to Numeric (Accounting Numbers) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180842#M34530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try the comma. informat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(INPUT(txt_to_numeric,COMMA23.)) as txt_to_numeric length = 8&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Nov 2014 08:25:05 GMT</pubDate>
    <dc:creator>Vladislaff</dc:creator>
    <dc:date>2014-11-21T08:25:05Z</dc:date>
    <item>
      <title>Conversion from Character to Numeric (Accounting Numbers)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180839#M34527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use the INPUT function in order for me to convert character to numeric variable:&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;(INPUT(txt_to_numeric,23.)) as txt_to_numeric length = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am having an issue converting it to numeric. If the character variable is enclosed in parenthesis, in accounting term this is a negative value, the input function does not read it as a negative value but rather it reads it as NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May I know how to revise my code such that if the character value is (5) for example, it will convert it to numeric value as -5? Thanks. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 07:25:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180839#M34527</guid>
      <dc:creator>01SASUser</dc:creator>
      <dc:date>2014-11-21T07:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Character to Numeric (Accounting Numbers)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180840#M34528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The IBAN (&lt;A href="http://en.wikipedia.org/wiki/International_Bank_Account_Number" title="http://en.wikipedia.org/wiki/International_Bank_Account_Number"&gt;International Bank Account Number - Wikipedia, the free encyclopedia&lt;/A&gt;) is a number?&amp;nbsp; Come on, it is containing LETTERS.&lt;/P&gt;&lt;P&gt;Numbers in SAS are float &lt;A href="https://support.sas.com/techsup/technote/ts654.pdf" title="https://support.sas.com/techsup/technote/ts654.pdf"&gt;https://support.sas.com/techsup/technote/ts654.pdf&lt;/A&gt; keep them on length 8 as it is the default and standard &lt;A href="http://en.wikipedia.org/wiki/Double-precision_floating-point_format" title="http://en.wikipedia.org/wiki/Double-precision_floating-point_format"&gt;Double-precision floating-point format - Wikipedia, the free encyclopedia&lt;/A&gt; implemented by Intel and other chip-baking processors (CPU).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you are happy with a precision of meaningfull 12 digits (not those 23) you can use it. Needing more precision you could investigate proc ds2.&lt;/P&gt;&lt;P&gt;Reading numeric goes by informats, there are a lot of them including commax. &lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n0aggga4tdr094n14ecw1smkhva7.htm" title="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n0aggga4tdr094n14ecw1smkhva7.htm"&gt;SAS(R) 9.4 Formats and Informats: Reference&lt;/A&gt;&amp;nbsp; (reading those () )&amp;nbsp; &lt;/P&gt;&lt;P&gt;When there as a dedicated format needed you can create that using proc format / fcmp&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 08:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180840#M34528</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-11-21T08:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Character to Numeric (Accounting Numbers)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180841#M34529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't know out of my head if there is an informat for this. You may have to do the conversion manually. Replace the leading "(" with "-", omit the trailing ")".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 08:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180841#M34529</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-11-21T08:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Character to Numeric (Accounting Numbers)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180842#M34530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try the comma. informat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(INPUT(txt_to_numeric,COMMA23.)) as txt_to_numeric length = 8&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 08:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180842#M34530</guid>
      <dc:creator>Vladislaff</dc:creator>
      <dc:date>2014-11-21T08:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Character to Numeric (Accounting Numbers)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180843#M34531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use another informat:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
input x percent.;
cards;
5
(5)
4
9
;
run;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Nov 2014 12:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conversion-from-Character-to-Numeric-Accounting-Numbers/m-p/180843#M34531</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-11-21T12:38:29Z</dc:date>
    </item>
  </channel>
</rss>

