<?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: sas sql last business day of the month in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285011#M58183</link>
    <description>I think from a set of records I would rather go with a filter approach:&lt;BR /&gt;&lt;BR /&gt;Select max(business_day) as max day&lt;BR /&gt;From have&lt;BR /&gt;Where weekday(business_day) not in(1,7);&lt;BR /&gt;&lt;BR /&gt;You could further develop this by adding a lookup table with site specific holidays which could use in the filter as well.</description>
    <pubDate>Sat, 16 Jul 2016 08:43:07 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-07-16T08:43:07Z</dc:date>
    <item>
      <title>sas sql last business day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/284973#M58173</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;i have a fairly simple question. I would like to use&lt;/P&gt;
&lt;P&gt;proc sql in SAS to extract the last business day from a set of records.&lt;/P&gt;
&lt;P&gt;Not sure how I can do that.&lt;/P&gt;
&lt;P&gt;Any help is appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2016 22:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/284973#M58173</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2016-07-15T22:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: sas sql last business day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/284976#M58174</link>
      <description>&lt;P&gt;Business day is a hard definition and not built into SAS because of various holidays around the world.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find the last weekday using the INTNX function, but its usually relative to some other day so I'm not sure what you're referencing. Use the WEEKDAY as the interval in INTNX along with the respective alignment to get the last one desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2016 23:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/284976#M58174</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-15T23:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: sas sql last business day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285011#M58183</link>
      <description>I think from a set of records I would rather go with a filter approach:&lt;BR /&gt;&lt;BR /&gt;Select max(business_day) as max day&lt;BR /&gt;From have&lt;BR /&gt;Where weekday(business_day) not in(1,7);&lt;BR /&gt;&lt;BR /&gt;You could further develop this by adding a lookup table with site specific holidays which could use in the filter as well.</description>
      <pubDate>Sat, 16 Jul 2016 08:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285011#M58183</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-07-16T08:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: sas sql last business day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285044#M58197</link>
      <description>Hi thanks so much for your response but I would like to only pull a smaller number of records since pulling all records takes more time that's why I need to use sql , I guess th better logic really is to use sql in SAS to pull records on the last available date in any given month &lt;BR /&gt;</description>
      <pubDate>Sat, 16 Jul 2016 15:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285044#M58197</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2016-07-16T15:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: sas sql last business day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285058#M58201</link>
      <description>What do you mean by "pull"?&lt;BR /&gt;You need to scan all records to find the highest date, or am I missing something in your logic?</description>
      <pubDate>Sat, 16 Jul 2016 21:05:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285058#M58201</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-07-16T21:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: sas sql last business day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285075#M58205</link>
      <description>Hello&lt;BR /&gt;Sorry for not being clear. Thanks again for your help. I am trying to get a subset of records from a table in oracle I use proc sql&lt;BR /&gt;In SAS and connection from odbc. The table has an entry every week day I would like to get the last entry in any given month &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 17 Jul 2016 00:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285075#M58205</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2016-07-17T00:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: sas sql last business day of the month</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285082#M58207</link>
      <description>&lt;PRE&gt;
So you want the last working day of each month ?


data have;
input date : date9.;
format date date9.;
cards;
29jan2016
29apr2016
31may2016
30jun2016
30jul2016
;
run;
proc sql;
select *
 from have
  where date=intnx('weekday',intnx('month',date,0,'e'),0);
quit;


&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jul 2016 02:08:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-sql-last-business-day-of-the-month/m-p/285082#M58207</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-17T02:08:06Z</dc:date>
    </item>
  </channel>
</rss>

