<?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 Weekdays in DATA SET in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Weekdays-in-DATA-SET/m-p/134816#M36524</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;Is there a command to show the working days a year in a data set?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jun 2014 19:17:33 GMT</pubDate>
    <dc:creator>hugo_spss</dc:creator>
    <dc:date>2014-06-09T19:17:33Z</dc:date>
    <item>
      <title>Weekdays in DATA SET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Weekdays-in-DATA-SET/m-p/134816#M36524</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;Is there a command to show the working days a year in a data set?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2014 19:17:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Weekdays-in-DATA-SET/m-p/134816#M36524</guid>
      <dc:creator>hugo_spss</dc:creator>
      <dc:date>2014-06-09T19:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Weekdays in DATA SET</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Weekdays-in-DATA-SET/m-p/134817#M36525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to qualify what you mean by "weekdays" or "workdays" in a data set. You can set a flag for a given SAS date type variable as to whethere it is a weekday but the code varies by national location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example in a data step given a SAS data variable called date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WeekDayFlag = (weekday(date) in (2,3,4,5,6)); /* will set a value of 1 for Monday through Friday in most US installations and 0*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if you mean workdays to exclude certain holidays or observances you will need to define them. Also does the organization work on Saturday?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a Holiday function that return the date of some holidays for a given year but if you have something not on that list ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could modify the flag above say for a given holiday similar to:(assumes "year" of data is 2013)&lt;/P&gt;&lt;P&gt;If date=holiday('easter',2013) then WeekDayFlag=0; /* assuming Easter isn't a day you want counted*/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2014 20:29:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Weekdays-in-DATA-SET/m-p/134817#M36525</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-06-09T20:29:45Z</dc:date>
    </item>
  </channel>
</rss>

