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.
How do I turn Score and Denominator into numeric?
How to I format the percentage so that it's numeric yet still has the % symbol?
data CMS.cms_database_sas;
length Provider_Number $ 8 Hospital_Name $70 Condition $ 29
Measure_Code $ 10 Measure_Name $ 174 Score $ 4 Sample
$ 13 Footnote $ 5;
infile 'CMS_database.csv' dlm=',' dsd missover lrecl=350;
input Provider_Number $ Hospital_Name $ Condition $ Measure_Code
$ Measure_Name $ Score $ Sample $ Footnote $;
Denominator = scan(Sample,1,'');
Numerator = (denominator*((scan(Score,1,'%'))/100));
format numerator 4.
denominator 4.;
run;
proc print data=CMS.cms_database_sas;
var Provider_Number Measure_Code Score Denominator Numerator;
where Score NE ' ';
run;