<?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: Calculate the sum of a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculate-the-sum-of-a-variable/m-p/699661#M214027</link>
    <description>&lt;P&gt;Your code will not run. Look at the log.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Nov 2020 03:51:35 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-11-18T03:51:35Z</dc:date>
    <item>
      <title>Calculate the sum of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-the-sum-of-a-variable/m-p/699651#M214024</link>
      <description>&lt;PRE class="tw-data-text tw-text-large XcVN5d tw-ta"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;How would I be able to create a code for this without using an sql procedure?&lt;BR /&gt;&lt;BR /&gt;Determine the day of the week (Monday to Friday) for which the total observed usage time during the study period was the highest. The result of your procedure should show the days of week only.&lt;BR /&gt;&lt;BR /&gt;I want to have a table with The weekdays and their total of usage time. To do so I have to calculate the sum of the usage time and exclude the weekend days.There are multiple observations for the usage time per day. This is what I have so far:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;PROC SUMMARY DATA=NewBixi;
	VAR Timeusage;
	OUTPUT OUT=Usage SUM=;
	BY Day;
RUN;
PROC PRINT DATA=Usage;
	ID Day;
	WHERE Jour not in("Sunday";"Saturday");
RUN;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;However; Saturday still shows in my table and I do not want to have the _type_ and _Freq_ columns in my final table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 01:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-the-sum-of-a-variable/m-p/699651#M214024</guid>
      <dc:creator>fayemelissa</dc:creator>
      <dc:date>2020-11-18T01:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the sum of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-the-sum-of-a-variable/m-p/699661#M214027</link>
      <description>&lt;P&gt;Your code will not run. Look at the log.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 03:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-the-sum-of-a-variable/m-p/699661#M214027</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-18T03:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the sum of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-the-sum-of-a-variable/m-p/699672#M214030</link>
      <description>&lt;P&gt;Please post the data you have in usable form.&lt;/P&gt;
&lt;P&gt;I would expect one date variable to be part of the data, allowing the usage of the format-statement in proc summary to get the required aggregation. To remove unwanted variable, use the keep/drop dataset-option in the output-statement of proc summary. The code is, of course, untested:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have nway;
  class Day;
  var Timeusage;
  format Day weekday.;
  output out=result(drop= _type_ _freq_) sum=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Nov 2020 05:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-the-sum-of-a-variable/m-p/699672#M214030</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-11-18T05:50:22Z</dc:date>
    </item>
  </channel>
</rss>

