<?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 problem using SUM function in sas in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/problem-using-SUM-function-in-sas/m-p/172200#M44412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data mydata&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;input score1_score3;&lt;/P&gt;&lt;P&gt;sum ( of score1-score3)= s;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;23 36 . &lt;/P&gt;&lt;P&gt;23 67 89&lt;/P&gt;&lt;P&gt;.&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;&lt;P&gt;21 .&amp;nbsp; 43&lt;/P&gt;&lt;P&gt;22 32 78&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made up this data set , which resembles my real data problem with using sum function and got following error. I don't understand it, I checked sas documentation and examples. This is the way sas has given examples to find sum of entries in variables. Why is this not working????? what is meant by the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7173&amp;nbsp; data mydata&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;7174&amp;nbsp; input score1_score3;&lt;/P&gt;&lt;P&gt;7175&amp;nbsp; sum ( of score1-score3)= s;&lt;/P&gt;&lt;P&gt;ERROR: &lt;STRONG&gt;Undeclared array referenced: sum.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Variable sum has not been declared as an array.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;7176&amp;nbsp; datalines;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Nov 2014 17:31:42 GMT</pubDate>
    <dc:creator>Ruhi</dc:creator>
    <dc:date>2014-11-14T17:31:42Z</dc:date>
    <item>
      <title>problem using SUM function in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-using-SUM-function-in-sas/m-p/172200#M44412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data mydata&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;input score1_score3;&lt;/P&gt;&lt;P&gt;sum ( of score1-score3)= s;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;23 36 . &lt;/P&gt;&lt;P&gt;23 67 89&lt;/P&gt;&lt;P&gt;.&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;&lt;P&gt;21 .&amp;nbsp; 43&lt;/P&gt;&lt;P&gt;22 32 78&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made up this data set , which resembles my real data problem with using sum function and got following error. I don't understand it, I checked sas documentation and examples. This is the way sas has given examples to find sum of entries in variables. Why is this not working????? what is meant by the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7173&amp;nbsp; data mydata&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;7174&amp;nbsp; input score1_score3;&lt;/P&gt;&lt;P&gt;7175&amp;nbsp; sum ( of score1-score3)= s;&lt;/P&gt;&lt;P&gt;ERROR: &lt;STRONG&gt;Undeclared array referenced: sum.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Variable sum has not been declared as an array.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;7176&amp;nbsp; datalines;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 17:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-using-SUM-function-in-sas/m-p/172200#M44412</guid>
      <dc:creator>Ruhi</dc:creator>
      <dc:date>2014-11-14T17:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem using SUM function in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-using-SUM-function-in-sas/m-p/172201#M44413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Possible typo: score1_score3 resulting in single variable, score1 - score 3 likely intended. If this is what executed then the variables score1 through score3 were not created.&lt;/P&gt;&lt;P&gt;Order of expression:&lt;/P&gt;&lt;P&gt;s = sum (of scor1 - score3);&amp;nbsp; The receiving value MUST be on the left of the =. Basically the construct variablename() = value is reserved for arrays.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 17:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-using-SUM-function-in-sas/m-p/172201#M44413</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-11-14T17:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: problem using SUM function in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/problem-using-SUM-function-in-sas/m-p/172202#M44414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data mydata;&lt;/P&gt;&lt;P&gt;infile datalines missover;&lt;/P&gt;&lt;P&gt;input score1 score2 score3;&lt;/P&gt;&lt;P&gt;s=sum(of score1-score3);&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;23 36 . &lt;/P&gt;&lt;P&gt;23 67 89&lt;/P&gt;&lt;P&gt;.&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;&lt;P&gt;21 .&amp;nbsp; 43&lt;/P&gt;&lt;P&gt;22 32 78&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 17:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/problem-using-SUM-function-in-sas/m-p/172202#M44414</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-11-14T17:44:40Z</dc:date>
    </item>
  </channel>
</rss>

