<?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 Sum didn't work in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sum-didn-t-work/m-p/889703#M351537</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a sum variable to add up all the columns, the sum results are all missing.&amp;nbsp; All the columns are dollar10.2, why?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 17 Aug 2023 17:09:25 GMT</pubDate>
    <dc:creator>ybz12003</dc:creator>
    <dc:date>2023-08-17T17:09:25Z</dc:date>
    <item>
      <title>Sum didn't work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-didn-t-work/m-p/889703#M351537</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a sum variable to add up all the columns, the sum results are all missing.&amp;nbsp; All the columns are dollar10.2, why?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Aug 2023 17:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-didn-t-work/m-p/889703#M351537</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2023-08-17T17:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sum didn't work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-didn-t-work/m-p/889704#M351538</link>
      <description>&lt;P&gt;For every observations at least one of the values in missing.&lt;/P&gt;
&lt;P&gt;Are you sure all of the variables are numeric?&lt;/P&gt;
&lt;P&gt;Are you sure all of them have a value on every observation?&lt;/P&gt;
&lt;P&gt;Are you sure you typed the variable names properly in your assignment statement?&lt;/P&gt;
&lt;P&gt;If you want to treat missing values are zero then use the SUM() function instead of the addition operator.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;sum=sum(of Room_ED Room_ICU Room_Regular Physician_Fee Lab Radiology Diagnostic_Other Pharma Thera Unclass);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The format attached to the variable is only used for DISPLAYING the values.&amp;nbsp; It has no impact on the values themselves.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 17:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-didn-t-work/m-p/889704#M351538</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-17T17:18:22Z</dc:date>
    </item>
  </channel>
</rss>

