<?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 character to numeric in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/character-to-numeric/m-p/35828#M8888</link>
    <description>Hey, I'm new to SAS and am stuck. The following is part of my coding. Columns Score and Denominator are showing up as character values, while Numerator is showing up as numeric. I realize I have the character symbol in the length statement, but the statement won't run otherwise.&lt;BR /&gt;
&lt;BR /&gt;
How do I turn Score and Denominator into numeric?&lt;BR /&gt;
&lt;BR /&gt;
How to I format the percentage so that it's numeric yet still has the % symbol?&lt;BR /&gt;
&lt;BR /&gt;
data CMS.cms_database_sas;&lt;BR /&gt;
    length Provider_Number $ 8 Hospital_Name $70 Condition $ 29 &lt;BR /&gt;
               Measure_Code $ 10 Measure_Name $ 174 Score $ 4 Sample &lt;BR /&gt;
               $ 13 Footnote $ 5;&lt;BR /&gt;
    infile 'CMS_database.csv' dlm=',' dsd missover lrecl=350;&lt;BR /&gt;
    input Provider_Number $ Hospital_Name $ Condition $ Measure_Code &lt;BR /&gt;
               $ Measure_Name $ Score $ Sample $ Footnote $;&lt;BR /&gt;
		Denominator = scan(Sample,1,'');&lt;BR /&gt;
		Numerator = (denominator*((scan(Score,1,'%'))/100));&lt;BR /&gt;
    format numerator 4.&lt;BR /&gt;
               denominator 4.;&lt;BR /&gt;
run;	&lt;BR /&gt;
proc print data=CMS.cms_database_sas;&lt;BR /&gt;
	var Provider_Number Measure_Code Score Denominator Numerator;&lt;BR /&gt;
	where Score NE ' ';&lt;BR /&gt;
run;</description>
    <pubDate>Wed, 30 Dec 2009 22:51:11 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-12-30T22:51:11Z</dc:date>
    <item>
      <title>character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/character-to-numeric/m-p/35828#M8888</link>
      <description>Hey, I'm new to SAS and am stuck. The following is part of my coding. Columns Score and Denominator are showing up as character values, while Numerator is showing up as numeric. I realize I have the character symbol in the length statement, but the statement won't run otherwise.&lt;BR /&gt;
&lt;BR /&gt;
How do I turn Score and Denominator into numeric?&lt;BR /&gt;
&lt;BR /&gt;
How to I format the percentage so that it's numeric yet still has the % symbol?&lt;BR /&gt;
&lt;BR /&gt;
data CMS.cms_database_sas;&lt;BR /&gt;
    length Provider_Number $ 8 Hospital_Name $70 Condition $ 29 &lt;BR /&gt;
               Measure_Code $ 10 Measure_Name $ 174 Score $ 4 Sample &lt;BR /&gt;
               $ 13 Footnote $ 5;&lt;BR /&gt;
    infile 'CMS_database.csv' dlm=',' dsd missover lrecl=350;&lt;BR /&gt;
    input Provider_Number $ Hospital_Name $ Condition $ Measure_Code &lt;BR /&gt;
               $ Measure_Name $ Score $ Sample $ Footnote $;&lt;BR /&gt;
		Denominator = scan(Sample,1,'');&lt;BR /&gt;
		Numerator = (denominator*((scan(Score,1,'%'))/100));&lt;BR /&gt;
    format numerator 4.&lt;BR /&gt;
               denominator 4.;&lt;BR /&gt;
run;	&lt;BR /&gt;
proc print data=CMS.cms_database_sas;&lt;BR /&gt;
	var Provider_Number Measure_Code Score Denominator Numerator;&lt;BR /&gt;
	where Score NE ' ';&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 30 Dec 2009 22:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/character-to-numeric/m-p/35828#M8888</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-30T22:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: character to numeric</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/character-to-numeric/m-p/35829#M8889</link>
      <description>Your code either must declare the variables as numeric or create a different named variable and my suggestion is to use the INPUT function to assign the new variables (or you can let SAS to the conversion in an assignment statement but I don't recommend that technique).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 31 Dec 2009 14:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/character-to-numeric/m-p/35829#M8889</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-31T14:54:09Z</dc:date>
    </item>
  </channel>
</rss>

