<?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: output the first  month that working time over 250 hours in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238861#M55453</link>
    <description>&lt;P&gt;ok,&lt;/P&gt;&lt;P&gt;just like&amp;nbsp;&lt;/P&gt;&lt;P&gt;id m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12&lt;/P&gt;&lt;P&gt;1 &amp;nbsp;20 &amp;nbsp;30 &amp;nbsp;40 &amp;nbsp;34 &amp;nbsp;60 &amp;nbsp;70 &amp;nbsp;80 &amp;nbsp;30 60 &amp;nbsp;70 &amp;nbsp; &amp;nbsp; 90 &amp;nbsp; &amp;nbsp;40&lt;/P&gt;&lt;P&gt;2 10 &amp;nbsp; 24 &amp;nbsp; 40 &amp;nbsp;20 &amp;nbsp;40 &amp;nbsp;30 &amp;nbsp;60 20 50 &amp;nbsp;30 &amp;nbsp; &amp;nbsp;30 &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;&lt;P&gt;and more obs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mu require result&lt;/P&gt;&lt;P&gt;id m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 &amp;nbsp;First_month_over250&lt;/P&gt;&lt;P&gt;1 &amp;nbsp;20 &amp;nbsp;30 &amp;nbsp;40 &amp;nbsp;34 &amp;nbsp;60 &amp;nbsp;70 &amp;nbsp;80 &amp;nbsp;30 60 &amp;nbsp;70 &amp;nbsp; &amp;nbsp; 90 &amp;nbsp; &amp;nbsp;40 &amp;nbsp; &amp;nbsp; &amp;nbsp;6&lt;/P&gt;&lt;P&gt;2 10 &amp;nbsp; 24 &amp;nbsp; 40 &amp;nbsp;20 &amp;nbsp;40 &amp;nbsp;30 &amp;nbsp;60 20 50 &amp;nbsp;30 &amp;nbsp; &amp;nbsp;30 &amp;nbsp; &amp;nbsp; 30 &amp;nbsp; &amp;nbsp; &amp;nbsp;8&lt;/P&gt;&lt;P&gt;and more &amp;nbsp;obs&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Dec 2015 08:40:53 GMT</pubDate>
    <dc:creator>MMTG</dc:creator>
    <dc:date>2015-12-11T08:40:53Z</dc:date>
    <item>
      <title>output the first  month that working time over 250 hours</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238794#M55449</link>
      <description>&lt;P&gt;I have data about the working time in12 months of 1000 workers,&lt;/P&gt;&lt;P&gt;id m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12;&lt;/P&gt;&lt;P&gt;1 &amp;nbsp;30 &amp;nbsp;50............................................................30&lt;/P&gt;&lt;P&gt;2 &amp;nbsp;.........................................................................&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;1000....................................................................&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the first month that total working time over 250, if after 6 month , the first worker have 610 hours ,then the &lt;SPAN&gt;first monthis 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;need to create a &amp;nbsp;new variable(First_month) for this &amp;nbsp;value.I have tried retain and do until ,but always have problem.&lt;/P&gt;&lt;P&gt;do you give me some help, thanks very much!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 21:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238794#M55449</guid>
      <dc:creator>MMTG</dc:creator>
      <dc:date>2015-12-10T21:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: output the first  month that working time over 250 hours</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238796#M55450</link>
      <description>&lt;P&gt;You don't need retain, you need an array and a do loop. Your requirements are unclear as you mention 250 hours and 610. Please clarify.&lt;BR /&gt;&lt;BR /&gt;In the mean time try something like the following (untested)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
array mths(12) m1-m12;
total_time=0;
do i=1 to 12 while(sum&amp;lt;250);
total_time=sum(total_time, mths(i));
if total_time&amp;gt;250 then first_month=i;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Dec 2015 22:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238796#M55450</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-10T22:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: output the first  month that working time over 250 hours</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238803#M55451</link>
      <description>&lt;P&gt;It would help understand details of your problem if you included several complete rows of data and what the final outcome should look like for that example data.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 23:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238803#M55451</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-10T23:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: output the first  month that working time over 250 hours</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238857#M55452</link>
      <description>&lt;P&gt;sorry for the mistake, it is 250, not 610,&lt;/P&gt;&lt;P&gt;and i have do the same as you do ,&lt;/P&gt;&lt;P&gt;but it doesn't work ,because, if the 6th month have overed 250, then the 7th will also over 250, then all the first_month will be 12.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:01:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238857#M55452</guid>
      <dc:creator>MMTG</dc:creator>
      <dc:date>2015-12-11T08:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: output the first  month that working time over 250 hours</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238861#M55453</link>
      <description>&lt;P&gt;ok,&lt;/P&gt;&lt;P&gt;just like&amp;nbsp;&lt;/P&gt;&lt;P&gt;id m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12&lt;/P&gt;&lt;P&gt;1 &amp;nbsp;20 &amp;nbsp;30 &amp;nbsp;40 &amp;nbsp;34 &amp;nbsp;60 &amp;nbsp;70 &amp;nbsp;80 &amp;nbsp;30 60 &amp;nbsp;70 &amp;nbsp; &amp;nbsp; 90 &amp;nbsp; &amp;nbsp;40&lt;/P&gt;&lt;P&gt;2 10 &amp;nbsp; 24 &amp;nbsp; 40 &amp;nbsp;20 &amp;nbsp;40 &amp;nbsp;30 &amp;nbsp;60 20 50 &amp;nbsp;30 &amp;nbsp; &amp;nbsp;30 &amp;nbsp; &amp;nbsp; 30&lt;/P&gt;&lt;P&gt;and more obs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mu require result&lt;/P&gt;&lt;P&gt;id m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 &amp;nbsp;First_month_over250&lt;/P&gt;&lt;P&gt;1 &amp;nbsp;20 &amp;nbsp;30 &amp;nbsp;40 &amp;nbsp;34 &amp;nbsp;60 &amp;nbsp;70 &amp;nbsp;80 &amp;nbsp;30 60 &amp;nbsp;70 &amp;nbsp; &amp;nbsp; 90 &amp;nbsp; &amp;nbsp;40 &amp;nbsp; &amp;nbsp; &amp;nbsp;6&lt;/P&gt;&lt;P&gt;2 10 &amp;nbsp; 24 &amp;nbsp; 40 &amp;nbsp;20 &amp;nbsp;40 &amp;nbsp;30 &amp;nbsp;60 20 50 &amp;nbsp;30 &amp;nbsp; &amp;nbsp;30 &amp;nbsp; &amp;nbsp; 30 &amp;nbsp; &amp;nbsp; &amp;nbsp;8&lt;/P&gt;&lt;P&gt;and more &amp;nbsp;obs&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 08:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238861#M55453</guid>
      <dc:creator>MMTG</dc:creator>
      <dc:date>2015-12-11T08:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: output the first  month that working time over 250 hours</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238866#M55454</link>
      <description>&lt;P&gt;I have fixed it &amp;nbsp;by combining&amp;nbsp;"do until" with your procedures , you help me so much, thank you sincerely .&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 09:38:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/output-the-first-month-that-working-time-over-250-hours/m-p/238866#M55454</guid>
      <dc:creator>MMTG</dc:creator>
      <dc:date>2015-12-11T09:38:20Z</dc:date>
    </item>
  </channel>
</rss>

