Hello,
I created a sum variable to add up all the columns, the sum results are all missing. All the columns are dollar10.2, why?
data want;
format sum dollar10.2;
set test;
sum=.;
sum = Room_ED + Room_ICU + Room_Regular + Physician_Fee + Lab+Radiology + Diagnostic_Other + Pharma + Thera + Unclass;
keep id sum;
run;
For every observations at least one of the values in missing.
Are you sure all of the variables are numeric?
Are you sure all of them have a value on every observation?
Are you sure you typed the variable names properly in your assignment statement?
If you want to treat missing values are zero then use the SUM() function instead of the addition operator.
sum=sum(of Room_ED Room_ICU Room_Regular Physician_Fee Lab Radiology Diagnostic_Other Pharma Thera Unclass);
The format attached to the variable is only used for DISPLAYING the values. It has no impact on the values themselves.
If you want to see which values are missing remove the KEEP statement so all of the variables will be in the output dataset so you can review the values.
For every observations at least one of the values in missing.
Are you sure all of the variables are numeric?
Are you sure all of them have a value on every observation?
Are you sure you typed the variable names properly in your assignment statement?
If you want to treat missing values are zero then use the SUM() function instead of the addition operator.
sum=sum(of Room_ED Room_ICU Room_Regular Physician_Fee Lab Radiology Diagnostic_Other Pharma Thera Unclass);
The format attached to the variable is only used for DISPLAYING the values. It has no impact on the values themselves.
If you want to see which values are missing remove the KEEP statement so all of the variables will be in the output dataset so you can review the values.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.