<?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 Re: Sum of Scores in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/690123#M37254</link>
    <description>&lt;P&gt;Thank you so much for the feedback!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try the&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;Total2	=	SUM(of Score_1 - Score_3);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;approach but got an error saying&lt;/P&gt;&lt;P&gt;ERROR: Missing numeric suffix on a numbered variable list (Score_1 -Score_3).&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: 71-185 The SUM function call does not have enough arguments.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going to google the errors. But I was thinking maybe I should spell out the variables?&amp;nbsp; All the best, a&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2020 17:38:13 GMT</pubDate>
    <dc:creator>a_zacMD</dc:creator>
    <dc:date>2020-10-08T17:38:13Z</dc:date>
    <item>
      <title>Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689272#M37204</link>
      <description>&lt;P&gt;Using SAS Enterprise Guide,&amp;nbsp; I want to sum multiple numeric values and create a new "total" variable.&amp;nbsp; Ideally I would like to create something like&amp;nbsp; I feel like this should be relatively straightforward, but I am missing something.&amp;nbsp; Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Count&lt;/TD&gt;&lt;TD&gt;Score 1&lt;/TD&gt;&lt;TD&gt;Score 2&lt;/TD&gt;&lt;TD&gt;Score 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 06 Oct 2020 17:16:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689272#M37204</guid>
      <dc:creator>a_zacMD</dc:creator>
      <dc:date>2020-10-06T17:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689275#M37205</link>
      <description>&lt;P&gt;I think Total = SUM(of Score_1 - Score3) should do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 17:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689275#M37205</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-06T17:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689276#M37206</link>
      <description>I was hoping something like this might work:&lt;BR /&gt;ABC_Score = Score_1 + Score_2 + Score_3;&lt;BR /&gt;end;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Oct 2020 17:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689276#M37206</guid>
      <dc:creator>a_zacMD</dc:creator>
      <dc:date>2020-10-06T17:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689277#M37207</link>
      <description>See an example here: &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=basess&amp;amp;docsetTarget=p1lk9eu0cwz1djn1s565bgxfsxfk.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=basess&amp;amp;docsetTarget=p1lk9eu0cwz1djn1s565bgxfsxfk.htm&amp;amp;locale=en&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards, Jos</description>
      <pubDate>Tue, 06 Oct 2020 17:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689277#M37207</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2020-10-06T17:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689278#M37208</link>
      <description>&lt;P&gt;It should, but SUM will handle missing values where as a simple formula as I recall will not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me mock something up for you.&amp;nbsp; Give me a minute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 17:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689278#M37208</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-06T17:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689280#M37209</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/334359"&gt;@a_zacMD&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I was hoping something like this might work:&lt;BR /&gt;ABC_Score = Score_1 + Score_2 + Score_3;&lt;BR /&gt;end;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Give it a try! See what happens.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 17:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689280#M37209</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-06T17:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689281#M37210</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/334359"&gt;@a_zacMD&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider the below code and the results posted below it.&amp;nbsp; In the results, Total 1 is from&amp;nbsp;Score_1 + Score_2 + Score_3.&amp;nbsp; Total 2 is from SUM(of Score_1 - Score_3).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For datalines 1 through 4, all is well, and Totals 1 and 2 are the same.&amp;nbsp; But what about datalines 5 - 7?&amp;nbsp; Notice that there are missing values in the data.&amp;nbsp; Suddenly, Total 1 is also missing.&amp;nbsp; Why?&amp;nbsp; Well, recall that a mathematical operation on a missing value results in missing.&amp;nbsp; SUM on the other hand is a bit more sophisticated and just, in essence, skips missing values.&amp;nbsp; Hence, functions are generally to be preferred over mathematical operations whenever missing values may be at play.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA	Have;
	INFILE	Datalines	DSD	DLM='09'x	MISSOVER;

	INPUT	Count		$
			Score_1
			Score_2
			Score_3		
			;

	Total1	=	Score_1 + Score_2 + Score_3;
	Total2	=	SUM(of Score_1 - Score_3);

Datalines;
1	1	2	4
2	4	4	4
3	2	3	1
4	1	2	1
5	.	9	8
6	7	.	12
7	1
;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;Count	Score_1	Score_2	Score_3	Total1	Total2
1	1	2	4	7	7
2	4	4	4	12	12
3	2	3	1	6	6
4	1	2	1	4	4
5		9	8		17
6	7		12		19
7	1				1
&lt;/PRE&gt;
&lt;DIV id="tinyMceEditorjimbarbour_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 17:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/689281#M37210</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-06T17:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/690123#M37254</link>
      <description>&lt;P&gt;Thank you so much for the feedback!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try the&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;Total2	=	SUM(of Score_1 - Score_3);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;approach but got an error saying&lt;/P&gt;&lt;P&gt;ERROR: Missing numeric suffix on a numbered variable list (Score_1 -Score_3).&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: 71-185 The SUM function call does not have enough arguments.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going to google the errors. But I was thinking maybe I should spell out the variables?&amp;nbsp; All the best, a&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 17:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/690123#M37254</guid>
      <dc:creator>a_zacMD</dc:creator>
      <dc:date>2020-10-08T17:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/690124#M37255</link>
      <description>&lt;P&gt;If you use the - notation, make sure you use "of" before Score_1 otherwise SAS thinks you're trying to subtract Score_3 from Score_1.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Total2	=	SUM(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;of&lt;/STRONG&gt;&lt;/FONT&gt; Score_1 - Score_3);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, list the variables name by name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Total2	=	SUM(Score_1 Score_2 Score_3);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you've already got "of" in place, then post your code and your log, and let's have a look.&amp;nbsp; The "Insert Code" is really good for posting a log.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1602179121345.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50390iC7C2B905B27A9680/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1602179121345.png" alt="jimbarbour_0-1602179121345.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 17:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/690124#M37255</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-08T17:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/691920#M37320</link>
      <description>I found this string of suggestions on google groups (here &lt;A href="https://groups.google.com/g/comp.soft-sys.sas/c/9RxJi93icuw?pli=1" target="_blank"&gt;https://groups.google.com/g/comp.soft-sys.sas/c/9RxJi93icuw?pli=1&lt;/A&gt;)&lt;BR /&gt;And using a double hyphen worked!!!&lt;BR /&gt;&lt;BR /&gt;Thank you so much for all the help! I am sure I will be back with more questions and I hope to be able to provide support to other community members.&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Oct 2020 17:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/691920#M37320</guid>
      <dc:creator>a_zacMD</dc:creator>
      <dc:date>2020-10-15T17:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Scores</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/691968#M37325</link>
      <description>&lt;P&gt;Excellent!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both single hyphen notation and double hyphen notation are helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You probably know this now, but:&lt;/P&gt;
&lt;P&gt;Single hyphen works with variables that have a number at the end.&amp;nbsp; Var1, Var2, Var3, ... Var99. can be referred to as Var1 - Var99.&lt;/P&gt;
&lt;P&gt;Double hyphen works with variables that are contiguous in the Program Data Vector.&amp;nbsp; If you run a Proc Contents and use the VARNUM option, the list will be in variable order (not alphabetical order).&amp;nbsp; If you want a section (or all) of the variables, you can list the first and the last with a -- in between, and SAS will process all variables in between the first specified and the last.&amp;nbsp; The variables must be contiguous in order for this to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 21:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Sum-of-Scores/m-p/691968#M37325</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-10-15T21:32:03Z</dc:date>
    </item>
  </channel>
</rss>

