<?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: use of first and last variable in data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142881#M28597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for providing sample data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend a proc means instead of data step process. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of how that would work.&amp;nbsp; Some efficiency tricks:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use format dtdate9 on your datetime variable to summarize data by date&lt;/LI&gt;&lt;LI&gt;Use Range for the date variable to obtain the max time - min time&lt;/LI&gt;&lt;LI&gt;Datetime is stored as seconds, so convert to a number by dividing by 60 for minutes and another 60 for hours&lt;/LI&gt;&lt;LI&gt;Or for datetime use a time format, both options are shown in the output.&lt;/LI&gt;&lt;LI&gt;Not implemented - but you can add STATUS to the CLASS statement to summarize by local vs remote if required. &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=staff nway noprint;&lt;/P&gt;&lt;P&gt;class date name;&lt;/P&gt;&lt;P&gt;format date dtdate9.;&lt;/P&gt;&lt;P&gt;output out=want (drop=_:) sum(count)=r_count range(date)=duration;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want_output;&lt;/P&gt;&lt;P&gt;set want;&lt;/P&gt;&lt;P&gt;duration_time=duration;&lt;/P&gt;&lt;P&gt;duration=duration/60/60;&lt;/P&gt;&lt;P&gt;format duration;&lt;/P&gt;&lt;P&gt;format duration_time time5.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=want_output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jan 2015 19:59:29 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-01-28T19:59:29Z</dc:date>
    <item>
      <title>use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142879#M28595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two grouping variables: date and name. I extract hour from date (starttime). The goal is to compare remote versus local. There are two days of data for illustration.&lt;/P&gt;&lt;P&gt;I would like to calculate the number of worked hours per day per name (by taking the difference between starttime each day). &lt;/P&gt;&lt;P&gt;I would like also to calculate the total count per day per name. I have tried but was not successful. Here is the data and the code I tried. I appreciate any help.&lt;/P&gt;&lt;P&gt;DATA staff;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LENGTH status $ 6;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; INPUT @1 date datetime16. @18 name$ @23 count @25 status $; &lt;/P&gt;&lt;P&gt;CARDS; &lt;/P&gt;&lt;P&gt;04Jan11:17:00:00 Beth 3 remote&lt;/P&gt;&lt;P&gt;04Jan11:17:30:00 Beth 3 remote&lt;/P&gt;&lt;P&gt;04Jan11:18:00:00 Beth 2 remote&lt;/P&gt;&lt;P&gt;04Jan11:18:30:00 Beth 0 remote&lt;/P&gt;&lt;P&gt;04Jan11:19:00:00 Beth 2 remote&lt;/P&gt;&lt;P&gt;04Jan11:17:30:00 Barb 4 local&lt;/P&gt;&lt;P&gt;04Jan11:18:00:00 Barb 3 local&lt;/P&gt;&lt;P&gt;04Jan11:18:30:00 Barb 2 local&lt;/P&gt;&lt;P&gt;04Jan11:19:00:00 Barb 6 local&lt;/P&gt;&lt;P&gt;04Jan11:07:30:00 Alex 1 local&lt;/P&gt;&lt;P&gt;04Jan11:08:00:00 Alex 2 local&lt;/P&gt;&lt;P&gt;04Jan11:08:30:00 Alex 8 local&lt;/P&gt;&lt;P&gt;04Jan11:09:00:00 Alex 8 local&lt;/P&gt;&lt;P&gt;04Jan11:09:30:00 Alex 2 local&lt;/P&gt;&lt;P&gt;04Jan11:10:00:00 Alex 1 local&lt;/P&gt;&lt;P&gt;05Jan11:19:30:00 Beth 4 local&lt;/P&gt;&lt;P&gt;05Jan11:20:00:00 Beth 2 local&lt;/P&gt;&lt;P&gt;05Jan11:20:30:00 Beth 0 local&lt;/P&gt;&lt;P&gt;05Jan11:21:00:00 Beth 3 local&lt;/P&gt;&lt;P&gt;05Jan11:21:30:00 Beth 1 local&lt;/P&gt;&lt;P&gt;05Jan11:08:30:00 Barb 1 remote&lt;/P&gt;&lt;P&gt;05Jan11:09:00:00 Barb 6 remote&lt;/P&gt;&lt;P&gt;05Jan11:09:30:00 Barb 1 remote&lt;/P&gt;&lt;P&gt;05Jan11:10:00:00 Barb 6 remote&lt;/P&gt;&lt;P&gt;05Jan11:10:30:00 Barb 1 remote&lt;/P&gt;&lt;P&gt;05Jan11:11:00:00 Barb 2 remote&lt;/P&gt;&lt;P&gt;05Jan11:11:30:00 Barb 1 remote&lt;/P&gt;&lt;P&gt;05Jan11:10:30:00 Alex 0 local&lt;/P&gt;&lt;P&gt;05Jan11:11:00:00 Alex 3 local&lt;/P&gt;&lt;P&gt;05Jan11:11:30:00 Alex 4 local&lt;/P&gt;&lt;P&gt;; &lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;proc print data=staff noobs;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format date datetime18.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt; set staff;&lt;/P&gt;&lt;P&gt; datep=datepart(date);&lt;/P&gt;&lt;P&gt; starttime=hour(date);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by datep name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data summarize;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by datep name;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain R_time R_count;&lt;/P&gt;&lt;P&gt;/* number of worked hours per day per name */&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.name &amp;amp; first.datep then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R_time=starttime;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last.name &amp;amp; last.datep then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diff_time=starttime-R_time;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.name &amp;amp; first.datep then &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R_count=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R_count+count;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if last.name &amp;amp; last.datep;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final output would look like &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="342"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl68" height="21" width="64"&gt;datep&lt;/TD&gt;&lt;TD class="xl69" width="86"&gt;date&lt;/TD&gt;&lt;TD class="xl69" width="64"&gt;name&lt;/TD&gt;&lt;TD class="xl69" width="64"&gt;R_count&lt;/TD&gt;&lt;TD class="xl70" width="64"&gt;diff_time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;18631&lt;/TD&gt;&lt;TD align="right"&gt;1609754400&lt;/TD&gt;&lt;TD&gt;Alex&lt;/TD&gt;&lt;TD align="right"&gt;22&lt;/TD&gt;&lt;TD align="right" class="xl64"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;18631&lt;/TD&gt;&lt;TD align="right"&gt;1609786800&lt;/TD&gt;&lt;TD&gt;Barb&lt;/TD&gt;&lt;TD align="right"&gt;15&lt;/TD&gt;&lt;TD align="right" class="xl64"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;18631&lt;/TD&gt;&lt;TD align="right"&gt;1609786800&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;TD align="right" class="xl64"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;18632&lt;/TD&gt;&lt;TD align="right"&gt;1609846200&lt;/TD&gt;&lt;TD&gt;Alex&lt;/TD&gt;&lt;TD align="right"&gt;7&lt;/TD&gt;&lt;TD align="right" class="xl64"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="20"&gt;18632&lt;/TD&gt;&lt;TD align="right"&gt;1609846200&lt;/TD&gt;&lt;TD&gt;Barb&lt;/TD&gt;&lt;TD align="right"&gt;18&lt;/TD&gt;&lt;TD align="right" class="xl64"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="21"&gt;18632&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;1609882200&lt;/TD&gt;&lt;TD class="xl66"&gt;Beth&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;10&lt;/TD&gt;&lt;TD align="right" class="xl67"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 19:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142879#M28595</guid>
      <dc:creator>Marcusliat</dc:creator>
      <dc:date>2015-01-28T19:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142880#M28596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there, thank you for asking a question in Communities on SAS:&lt;/P&gt;&lt;P&gt;I am moving your question from the General Usage community to the' SAS Macro Facility, Data Step and SAS Language Elements' community so that you might find an answer more quickly. Thank you !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 19:22:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142880#M28596</guid>
      <dc:creator>Community_Help</dc:creator>
      <dc:date>2015-01-28T19:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142881#M28597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for providing sample data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would recommend a proc means instead of data step process. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of how that would work.&amp;nbsp; Some efficiency tricks:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use format dtdate9 on your datetime variable to summarize data by date&lt;/LI&gt;&lt;LI&gt;Use Range for the date variable to obtain the max time - min time&lt;/LI&gt;&lt;LI&gt;Datetime is stored as seconds, so convert to a number by dividing by 60 for minutes and another 60 for hours&lt;/LI&gt;&lt;LI&gt;Or for datetime use a time format, both options are shown in the output.&lt;/LI&gt;&lt;LI&gt;Not implemented - but you can add STATUS to the CLASS statement to summarize by local vs remote if required. &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=staff nway noprint;&lt;/P&gt;&lt;P&gt;class date name;&lt;/P&gt;&lt;P&gt;format date dtdate9.;&lt;/P&gt;&lt;P&gt;output out=want (drop=_:) sum(count)=r_count range(date)=duration;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want_output;&lt;/P&gt;&lt;P&gt;set want;&lt;/P&gt;&lt;P&gt;duration_time=duration;&lt;/P&gt;&lt;P&gt;duration=duration/60/60;&lt;/P&gt;&lt;P&gt;format duration;&lt;/P&gt;&lt;P&gt;format duration_time time5.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=want_output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 19:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142881#M28597</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-28T19:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142882#M28598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome! Thank you for the quick reply. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 20:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142882#M28598</guid>
      <dc:creator>Marcusliat</dc:creator>
      <dc:date>2015-01-28T20:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142883#M28599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a different scenario where the dates were different with a gap in between, using proc means with range(date)=duration does not work.&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;DATA staff;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp; LENGTH status $ 6;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&amp;nbsp;&amp;nbsp; INPUT @1 date datetime18. @18 name$ @23 count @25 status $;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;CARDS;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:00:05:35 Beth 3 remote&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:10:11:32 Beth 3 remote&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:15:34:20 Beth 2 remote&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:16:45:45 Beth 0 remote&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:17:00:19 Beth 2 remote&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:18:30:00 Beth 4 remote&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:20:00:00 Beth 3 remote&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:22:00:13 Beth 2 remote&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:00:30:00 Alex 1 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:12:00:00 Alex 2 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:13:30:00 Alex 8 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:14:00:00 Alex 8 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:15:30:00 Alex 2 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;04Jan11:16:00:00 Alex 1 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;05Jan11:17:30:00 Alex 4 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;05Jan11:20:06:00 Alex 2 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;05Jan11:21:12:00 Alex 0 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;05Jan11:22:10:36 Alex 3 local&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example for Beth the minimum is 04Jan11:00:05:13 and the maximum is &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;04Jan11:22:05:13 , giving a duration of 22 hours which is incorrect. Beth worked from &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;04Jan11:10:11:32 to &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;04Jan11:00:05:35 (&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;04Jan11:24:05:35) , a duration of approximately 14 hours. How your former code can be changed to obtain the correct duration? Also Alex started at &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;04Jan11:12:00:00 pm and get of at &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;04Jan11:00:30:00 (&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;04Jan11:24:10:00)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;I appreciate the help&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;Thanks.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 15:11:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142883#M28599</guid>
      <dc:creator>Marcusliat</dc:creator>
      <dc:date>2015-02-04T15:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142884#M28600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That doesn't make sense. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif;"&gt;04Jan11:00:05:35 (&lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif;"&gt;04Jan11:24:05:35) would be January 05 not January 04. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif;"&gt;In a 24 hour clock there is&amp;nbsp; no 24 hours, the hours go from 0 to 23.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 15:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142884#M28600</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-04T15:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142885#M28601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is right. What I mean is the following: Beth works from 24APR12:00:07:47 then get offs at 24APR12:07:16:59 and come back at 24APR12:21:51:31 to get off again at 24APR12:23:49:32 the same day&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 252px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="124"&gt;24APR12:00:07:47&lt;/TD&gt;&lt;TD align="right" width="64"&gt;2&lt;/TD&gt;&lt;TD width="64"&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:00:17:21&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:01:40:14&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:01:44:47&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:01:49:50&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:02:01:22&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:02:09:52&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:02:56:15&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:05:35:23&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:06:02:00&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:06:31:26&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:06:45:24&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:06:56:53&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:07:00:54&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:07:16:59&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:21:51:31&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:22:14:44&lt;/TD&gt;&lt;TD align="right"&gt;2&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:22:22:47&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:22:25:40&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:23:00:40&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:23:05:04&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:23:06:21&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:23:25:39&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;24APR12:23:49:32&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD&gt;Beth&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Thank you for your patience&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 15:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142885#M28601</guid>
      <dc:creator>Marcusliat</dc:creator>
      <dc:date>2015-02-04T15:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142886#M28602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So a duration of about 7 hours and then 2 hours?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you identify when a work day starts/ends?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 15:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142886#M28602</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-04T15:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142887#M28603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no way to identify in the data when it starts, when it ends. I have a rough idea based on schedule. I think I can't use these dates to find out duration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 15:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142887#M28603</guid>
      <dc:creator>Marcusliat</dc:creator>
      <dc:date>2015-02-04T15:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142888#M28604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You COULD make a rule that if there is a span of more than 5 (or X) hours between times that a new shift has started?&lt;/P&gt;&lt;P&gt;If some thing like that would work, post it as a new question. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 15:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142888#M28604</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-04T15:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: use of first and last variable in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142889#M28605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, will post it as a new question. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 16:14:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-of-first-and-last-variable-in-data-step/m-p/142889#M28605</guid>
      <dc:creator>Marcusliat</dc:creator>
      <dc:date>2015-02-04T16:14:57Z</dc:date>
    </item>
  </channel>
</rss>

