<?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 HELP! Automating ONLY the last  Biweekly Pay Date during the month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135354#M27504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our company has pay period endings that fall every two weeks on a Saturday. I’m trying to automate the last pay period date (Jan 18, Feb 15, Mar 29, etc.)&amp;nbsp; of the month into a macro for our monthly reports.&amp;nbsp; I am thinking I am supposed to do a loop, but I don’t know how to develop the logic because some months have two pay periods while others months have three pay periods.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some bi-weekly Pay Period Ending dates for January through April. I’m only needing that last Pay Period Ending Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jan=&amp;nbsp; 4 , 18 &lt;/P&gt;&lt;P&gt;Feb=&amp;nbsp; 1, 15&lt;/P&gt;&lt;P&gt;Mar= 1, 15, 29&lt;/P&gt;&lt;P&gt;Apr= 12,&amp;nbsp; 26&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If the current month is April I need to be able to pull the date “March 29”. If we are in the month of May, I need to pull the date April 26. I hope that I am explaining this okay. I’m new to this job and new to SAS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If someone could please help me that would be greatly appreciated.&amp;nbsp; Thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Apr 2014 23:37:56 GMT</pubDate>
    <dc:creator>mcrum1</dc:creator>
    <dc:date>2014-04-27T23:37:56Z</dc:date>
    <item>
      <title>HELP! Automating ONLY the last  Biweekly Pay Date during the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135354#M27504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our company has pay period endings that fall every two weeks on a Saturday. I’m trying to automate the last pay period date (Jan 18, Feb 15, Mar 29, etc.)&amp;nbsp; of the month into a macro for our monthly reports.&amp;nbsp; I am thinking I am supposed to do a loop, but I don’t know how to develop the logic because some months have two pay periods while others months have three pay periods.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some bi-weekly Pay Period Ending dates for January through April. I’m only needing that last Pay Period Ending Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jan=&amp;nbsp; 4 , 18 &lt;/P&gt;&lt;P&gt;Feb=&amp;nbsp; 1, 15&lt;/P&gt;&lt;P&gt;Mar= 1, 15, 29&lt;/P&gt;&lt;P&gt;Apr= 12,&amp;nbsp; 26&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If the current month is April I need to be able to pull the date “March 29”. If we are in the month of May, I need to pull the date April 26. I hope that I am explaining this okay. I’m new to this job and new to SAS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If someone could please help me that would be greatly appreciated.&amp;nbsp; Thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Apr 2014 23:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135354#M27504</guid>
      <dc:creator>mcrum1</dc:creator>
      <dc:date>2014-04-27T23:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Automating ONLY the last  Biweekly Pay Date during the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135355#M27505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is your initial value. But it seems all your want week is odd week . therefore&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;%let monyy=may2014;
data _null_;

do i=intnx('month',"01&amp;amp;monyy"d,-1,'b') to intnx('month',"01&amp;amp;monyy"d,-1,'e');
 if week lt week(i,'v') and mod(week(i,'v'),2)=1 and weekday(i)=7 then do;
&amp;nbsp; week=week(i,'v');day=i;
 end;
end;
call symputx('want',put(day,date9.));
run;
%put &amp;amp;want;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 01:02:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135355#M27505</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-04-28T01:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Automating ONLY the last  Biweekly Pay Date during the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135356#M27506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will give you all of the wanted Sat in one year (2014), tweaked as needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do Date="04jan2014"d by 14 while(year(date)=2014);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt; end;&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 sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select date format=date9.&amp;nbsp; from have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; group by put(date, yymon7.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having date=max(date)&lt;/P&gt;&lt;P&gt;&amp;nbsp; order by date&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 01:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135356#M27506</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-04-28T01:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: HELP! Automating ONLY the last  Biweekly Pay Date during the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135357#M27507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks this was really helpful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 15:51:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELP-Automating-ONLY-the-last-Biweekly-Pay-Date-during-the-month/m-p/135357#M27507</guid>
      <dc:creator>mcrum1</dc:creator>
      <dc:date>2014-04-29T15:51:15Z</dc:date>
    </item>
  </channel>
</rss>

