<?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 a variable if other variables have a spesific combination or if they match [how to improve your question] in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432429#M107107</link>
    <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/190237"&gt;@HelpPlease&lt;/a&gt;,&lt;/P&gt;&lt;BR /&gt; &lt;P&gt;Your question requires more details before experts can help.&amp;nbsp;Can you revise your question to include more information?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Review this checklist:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Specify a meaningful subject line for your topic.&amp;nbsp; Avoid generic subjects like "need help," "SAS query," or "urgent."&lt;/LI&gt;
&lt;LI&gt;When appropriate, provide sample data in text or DATA step format.&amp;nbsp; See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;this article for one method&lt;/A&gt;&amp;nbsp;you can use.&lt;/LI&gt;
&lt;LI&gt;If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition.&amp;nbsp;Use the&amp;nbsp;&lt;STRONG&gt;Photos&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;button to include the image in your message.&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 279px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16608i91A52F817EAC9A69/image-dimensions/279x150?v=1.0" width="279" height="150" alt="use_buttons.png" title="use_buttons.png" /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;It also helps to include an example (table or picture) of the result that you're trying to achieve.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;To edit your original message, select the "blue gear" icon at the top of the message and select&amp;nbsp;&lt;STRONG&gt;Edit Message&lt;/STRONG&gt;.&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;From there you can adjust the title and add more details to the body of the message.&amp;nbsp; Or, simply reply to this message with any additional information you can supply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 229px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16605iAC020BC79315B045/image-size/large?v=1.0&amp;amp;px=600" alt="edit_post.png" title="edit_post.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;SAS experts are eager to help -- help&amp;nbsp;&lt;EM&gt;them&lt;/EM&gt; by providing as much detail as you can.&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style:italic;font-size:smaller;"&gt;This prewritten response was triggered for you by fellow SAS Support Communities member &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;.</description>
    <pubDate>Tue, 30 Jan 2018 18:55:26 GMT</pubDate>
    <dc:creator>Community_Guide</dc:creator>
    <dc:date>2018-01-30T18:55:26Z</dc:date>
    <item>
      <title>Sum a variable if other variables have a spesific combination or if they match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432425#M107106</link>
      <description>&lt;P&gt;I hope someone can help me. I have a large data sets with four variables. The first 3 variables have duplicate rows where only the last variable is a different number. How do I sum the last variable for all the combinations of the first three variables? So if the first 3 variables as in B_CODE P_CODE and DATE have the same combination I want to sum the&amp;nbsp;the ACTUAL variable.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432425#M107106</guid>
      <dc:creator>HelpPlease</dc:creator>
      <dc:date>2018-01-30T19:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum a variable if other variables have a spesific combination or if they match [how to improve your question]</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432429#M107107</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/190237"&gt;@HelpPlease&lt;/a&gt;,&lt;/P&gt;&lt;BR /&gt; &lt;P&gt;Your question requires more details before experts can help.&amp;nbsp;Can you revise your question to include more information?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Review this checklist:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Specify a meaningful subject line for your topic.&amp;nbsp; Avoid generic subjects like "need help," "SAS query," or "urgent."&lt;/LI&gt;
&lt;LI&gt;When appropriate, provide sample data in text or DATA step format.&amp;nbsp; See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;this article for one method&lt;/A&gt;&amp;nbsp;you can use.&lt;/LI&gt;
&lt;LI&gt;If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition.&amp;nbsp;Use the&amp;nbsp;&lt;STRONG&gt;Photos&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;button to include the image in your message.&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 279px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16608i91A52F817EAC9A69/image-dimensions/279x150?v=1.0" width="279" height="150" alt="use_buttons.png" title="use_buttons.png" /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;It also helps to include an example (table or picture) of the result that you're trying to achieve.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;To edit your original message, select the "blue gear" icon at the top of the message and select&amp;nbsp;&lt;STRONG&gt;Edit Message&lt;/STRONG&gt;.&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;From there you can adjust the title and add more details to the body of the message.&amp;nbsp; Or, simply reply to this message with any additional information you can supply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 229px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16605iAC020BC79315B045/image-size/large?v=1.0&amp;amp;px=600" alt="edit_post.png" title="edit_post.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;SAS experts are eager to help -- help&amp;nbsp;&lt;EM&gt;them&lt;/EM&gt; by providing as much detail as you can.&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style:italic;font-size:smaller;"&gt;This prewritten response was triggered for you by fellow SAS Support Communities member &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;.</description>
      <pubDate>Tue, 30 Jan 2018 18:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432429#M107107</guid>
      <dc:creator>Community_Guide</dc:creator>
      <dc:date>2018-01-30T18:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum a variable if other variables have a spesific combination or if they match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432430#M107108</link>
      <description>&lt;P&gt;I think you're going to need to post some sample data so we understand what you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally include what you have, what you want, and what you've tried.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/190237"&gt;@HelpPlease&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I hope someone can help me. I have a large data sets with four variables. The first 3 variables have duplicate rows where only the last variable is a different number. How do I sum the last variable for all the combinations of the first three variables? So if the first 3 variables are equal I want to sum the last variable.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 18:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432430#M107108</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-30T18:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum a variable if other variables have a spesific combination or if they match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432435#M107111</link>
      <description>&lt;P&gt;I think this is what you are asking for.&amp;nbsp; It creates a SAS data set holding the totals of the last variable, for every possible combination of the first three:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have nway;&lt;/P&gt;
&lt;P&gt;class var1 var2 var3;&lt;/P&gt;
&lt;P&gt;var var4;&lt;/P&gt;
&lt;P&gt;output out=want (drop=_type_ _freq_) sum=total_var4;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The program requires some tweaking if it is possible that any of your first three variables ever take on a missing value.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 18:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432435#M107111</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-01-30T18:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum a variable if other variables have a spesific combination or if they match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432440#M107112</link>
      <description>&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please don't post PDF of images. Post text data - if your problem is more complex you're essentially asking someone to type your data to help you out.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432440#M107112</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-30T19:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum a variable if other variables have a spesific combination or if they match</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432442#M107113</link>
      <description>&lt;P&gt;Thank you I really appreciate it, it worked!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 19:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sum-a-variable-if-other-variables-have-a-spesific-combination-or/m-p/432442#M107113</guid>
      <dc:creator>HelpPlease</dc:creator>
      <dc:date>2018-01-30T19:08:04Z</dc:date>
    </item>
  </channel>
</rss>

