<?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: Character to Numeric conversion in output in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-Numeric-conversion-in-output/m-p/193039#M48451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't use a character informat in the first place? Remove the $ sign, I would also use the DSD option and Truncover on my infile statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;data get_data;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Length Supplier $20. City $20.&amp;nbsp; Item Category $20.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;format cost revenue unit_price dollar12.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;informat cost revenue unit_price dollar12.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;infile " file location of the excel where it is located" DSD truncover;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Input Supplier $ City $ Item Category $ Month $ Cost Revenue&amp;nbsp; Unit_Price&amp;nbsp; Units_Available Units_Sold;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;proc print;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Mar 2015 17:30:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-03-03T17:30:20Z</dc:date>
    <item>
      <title>Character to Numeric conversion in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-Numeric-conversion-in-output/m-p/193038#M48450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Supplier&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;City&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Item Category&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Month&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Cost&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Revenue&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Unit Price&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Units Available&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Units Sold&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Bantam Books&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Annapolis&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Art &amp;amp; Architecture&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Jan&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$38,136&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$47,760&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$105.00&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;655&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;454&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Bantam Books&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Annapolis&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Art &amp;amp; Architecture&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Feb&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$11,919&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$56,785&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$54.00&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;429&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;388&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Bantam Books&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Annapolis&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Art &amp;amp; Architecture&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mar&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$1,24,897&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$98,586`&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;$98.00&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;89&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an excel csv file, which has 9 variables and some 24 observations for each variable. The variables are in order they appear:&lt;/P&gt;&lt;P&gt;1. Supplier&lt;/P&gt;&lt;P&gt;2. City&lt;/P&gt;&lt;P&gt;3. Item Category&lt;/P&gt;&lt;P&gt;4. Month&lt;/P&gt;&lt;P&gt;5. Cost&lt;/P&gt;&lt;P&gt;6. Revenue&lt;/P&gt;&lt;P&gt;7. Unit Price&lt;/P&gt;&lt;P&gt;8. Units Available&lt;/P&gt;&lt;P&gt;9. Units Sold.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only confusion is:&amp;nbsp; Cost and Revenue has $ associated with it ($38,000 for example) and Unit Price as $105.00 . Not sure, how do I convert this to Numeric format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I wrote a code for this as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data get_data;&lt;/P&gt;&lt;P&gt;infile " file location of the excel where it is located";&lt;/P&gt;&lt;P&gt;Length Supplier $20. City $20.&amp;nbsp; Item Category $20.;&lt;/P&gt;&lt;P&gt;Input Supplier $ City $ Item Category $ Month $ Cost $ Revenue $ Unit Price $ Units Available Units Sold;&lt;/P&gt;&lt;P&gt;numeric=input(Cost, 8.);&lt;/P&gt;&lt;P&gt;numeric=input(Revenue, 10.);&lt;/P&gt;&lt;P&gt;numeric=input(Unit Price, 8.);&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It gives an error for this code and the values are not read properly into SAS . It says no result to display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please assist me in writing the right code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mohammed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please assist&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 17:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-Numeric-conversion-in-output/m-p/193038#M48450</guid>
      <dc:creator>Mohammed</dc:creator>
      <dc:date>2015-03-03T17:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Character to Numeric conversion in output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Character-to-Numeric-conversion-in-output/m-p/193039#M48451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't use a character informat in the first place? Remove the $ sign, I would also use the DSD option and Truncover on my infile statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;data get_data;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Length Supplier $20. City $20.&amp;nbsp; Item Category $20.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;format cost revenue unit_price dollar12.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;informat cost revenue unit_price dollar12.;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;infile " file location of the excel where it is located" DSD truncover;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Input Supplier $ City $ Item Category $ Month $ Cost Revenue&amp;nbsp; Unit_Price&amp;nbsp; Units_Available Units_Sold;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;proc print;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 17:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Character-to-Numeric-conversion-in-output/m-p/193039#M48451</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-03-03T17:30:20Z</dc:date>
    </item>
  </channel>
</rss>

