<?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: how to SUM time (1:30, 1:45 etc.) by user ID in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982201#M379274</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/408219"&gt;@msrenee1984&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm getting an error message that says "ERROR: Variable HOURS in list does not match type prescribed for this list.&amp;nbsp; I'm unsure how to convert the "hours" variable...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This means that your hours variable is most probably of type character.&lt;/P&gt;
&lt;P&gt;Follow the instructions posted by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;and post the resulting code.&amp;nbsp;&lt;STRONG&gt;This is mandatory!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Only then will we know important variable attributes (type, length, format) and the real content we have to work with.&lt;/P&gt;
&lt;P&gt;Excel spreadsheets do not have this information, only what Excel&amp;nbsp;&lt;EM&gt;thinks&lt;/EM&gt; about it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also answer questions like where does the data originate from, and how do you read it into your SAS environment?&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jan 2026 12:37:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2026-01-20T12:37:02Z</dc:date>
    <item>
      <title>how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982196#M379269</link>
      <description>&lt;P&gt;Hello, I'm inquiring how to SUM a column of student hours (1:30, 1:45, etc.) by their student ID, class subject, and YEAR.&amp;nbsp; Would like my report to show total class hours by each student for each year for year subject("sType").&amp;nbsp; I've attached an example...actual dataset has thousands of rows.&amp;nbsp; Thank you for any assistance!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982196#M379269</guid>
      <dc:creator>msrenee1984</dc:creator>
      <dc:date>2026-01-20T12:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982197#M379270</link>
      <description>&lt;P&gt;Any method in SAS that sums a numeric variable will work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Almost no one here will download Excel files as they can be security threats. The best way to include data in your example is via working SAS data step&amp;nbsp; code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;instructions and examples&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, here is code using PROC SUMMARY which does the summing. I have made up variable names since I don't know the variable names in your Excel file.&amp;nbsp;This assumes that 1:30 (one hour 30 minutes) is numeric and unformatted appears as 5400 (which is 60 seconds per minute * 60 minutes per hour * 1.5 hours). It gives the sum of the number of seconds. It also works if 1 hour and 30 minutes is represented as 1.5, then it gives the sum of the number of hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data = ____________;
    class stype year student_id;
    var hours;
    output out=sums sum=sum_hours;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:20:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982197#M379270</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-01-20T12:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982198#M379271</link>
      <description>&lt;P&gt;Thank you very much Paige... I will reframe from uploading excel and just post my code in my question!!! I will try the PROC summary now!! (Yes, its 1hr and 30 minutes!)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982198#M379271</guid>
      <dc:creator>msrenee1984</dc:creator>
      <dc:date>2026-01-20T12:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982199#M379272</link>
      <description>&lt;P&gt;I'm getting an error message that says "ERROR: Variable HOURS in list does not match type prescribed for this list.&amp;nbsp; I'm unsure how to convert the "hours" variable...&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982199#M379272</guid>
      <dc:creator>msrenee1984</dc:creator>
      <dc:date>2026-01-20T12:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982200#M379273</link>
      <description>&lt;P&gt;Your hours must be character variables, not numeric variables. You can't sum character variables. You can convert these into actual numbers. If you can show us how the variable hours appears in your data (just type in an example), we can advise further.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982200#M379273</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-01-20T12:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982201#M379274</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/408219"&gt;@msrenee1984&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm getting an error message that says "ERROR: Variable HOURS in list does not match type prescribed for this list.&amp;nbsp; I'm unsure how to convert the "hours" variable...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This means that your hours variable is most probably of type character.&lt;/P&gt;
&lt;P&gt;Follow the instructions posted by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;and post the resulting code.&amp;nbsp;&lt;STRONG&gt;This is mandatory!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Only then will we know important variable attributes (type, length, format) and the real content we have to work with.&lt;/P&gt;
&lt;P&gt;Excel spreadsheets do not have this information, only what Excel&amp;nbsp;&lt;EM&gt;thinks&lt;/EM&gt; about it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also answer questions like where does the data originate from, and how do you read it into your SAS environment?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982201#M379274</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2026-01-20T12:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982203#M379275</link>
      <description>&lt;P&gt;Yes, I just double checked it's a character variable CHAR length 5.&amp;nbsp; Attaching the actual column below.&amp;nbsp; Thank you!&lt;/P&gt;
&lt;TABLE width="81"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;HOURS&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;0:00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;0:00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;0:00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;2:00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;1:45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="81"&gt;0:00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982203#M379275</guid>
      <dc:creator>msrenee1984</dc:creator>
      <dc:date>2026-01-20T12:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982204#M379276</link>
      <description>&lt;P&gt;Also note that the communities website does not provide the usual online preview which would allow us to view the spreadsheet without downloading. This is suspicious.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982204#M379276</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2026-01-20T12:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982205#M379277</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
    set old;
    hours_n=input(hours,hhmmss5.);
    format hours_n hhmm5.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data set NEW should be run through PROC SUMMARY using the new variable named HOURS_N, and PROC SUMMARY should do the summing properly.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 12:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982205#M379277</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2026-01-20T12:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to SUM time (1:30, 1:45 etc.) by user ID</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982245#M379282</link>
      <description>&lt;P&gt;this worked perfectly, thank you very much!!!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 19:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-SUM-time-1-30-1-45-etc-by-user-ID/m-p/982245#M379282</guid>
      <dc:creator>msrenee1984</dc:creator>
      <dc:date>2026-01-20T19:36:52Z</dc:date>
    </item>
  </channel>
</rss>

