<?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 Weekday from Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198509#M305587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Hello SAS community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a large dataset of 7500 subjects with procedure dates in mm/dd/yyyy format and I need to know which weekday the procedure date would be; I am trying to basically analyze if subjects who had procedures during weekday (monday to friday) and during regular work time (7am-7pm) compared to off-peak hours (7pm-7am on mon to friday AND sat, sun)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to know that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS instructions says: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WEEKDAY( &lt;EM&gt;date&lt;/EM&gt; )&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1.4em;"&gt;&lt;A class="syntaxindex" id="etsug.intervals.a0000000066" style="font-family: inherit;"&gt;&lt;/A&gt;returns the day of the week from a SAS date value. For example &lt;STRONG&gt;WEEKDAY=WEEKDAY(’17OCT1991’D);&lt;/STRONG&gt; returns &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0011.png" style="font-family: inherit;" /&gt;, the numerical value for Thursday.&lt;/P&gt;&lt;P&gt;But, I am not quite sure how to use this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I havevariable "proceduredate" in mm/dd/yyyy format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and appreciate your time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Jun 2015 23:59:53 GMT</pubDate>
    <dc:creator>Venki</dc:creator>
    <dc:date>2015-06-02T23:59:53Z</dc:date>
    <item>
      <title>Weekday from Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198509#M305587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Hello SAS community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a large dataset of 7500 subjects with procedure dates in mm/dd/yyyy format and I need to know which weekday the procedure date would be; I am trying to basically analyze if subjects who had procedures during weekday (monday to friday) and during regular work time (7am-7pm) compared to off-peak hours (7pm-7am on mon to friday AND sat, sun)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to know that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS instructions says: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WEEKDAY( &lt;EM&gt;date&lt;/EM&gt; )&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1.4em;"&gt;&lt;A class="syntaxindex" id="etsug.intervals.a0000000066" style="font-family: inherit;"&gt;&lt;/A&gt;returns the day of the week from a SAS date value. For example &lt;STRONG&gt;WEEKDAY=WEEKDAY(’17OCT1991’D);&lt;/STRONG&gt; returns &lt;IMG alt="" class="math gen jiveImage" src="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/images/etsug_intervals0011.png" style="font-family: inherit;" /&gt;, the numerical value for Thursday.&lt;/P&gt;&lt;P&gt;But, I am not quite sure how to use this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I havevariable "proceduredate" in mm/dd/yyyy format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and appreciate your time&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Venki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2015 23:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198509#M305587</guid>
      <dc:creator>Venki</dc:creator>
      <dc:date>2015-06-02T23:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Weekday from Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198510#M305588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you have a SAS date, numeric variable, date format then use the formula in the example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;weekday=weekday(proceduredate);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 00:05:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198510#M305588</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-06-03T00:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Weekday from Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198511#M305589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just figured it out&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just a simple command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;weekday=weekday(arrivaldate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did it and returned a value of 1 for sunday and onwards.....nice !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 00:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198511#M305589</guid>
      <dc:creator>Venki</dc:creator>
      <dc:date>2015-06-03T00:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Weekday from Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198512#M305590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much ! Appreciate it !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 00:20:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Weekday-from-Date/m-p/198512#M305590</guid>
      <dc:creator>Venki</dc:creator>
      <dc:date>2015-06-03T00:20:00Z</dc:date>
    </item>
  </channel>
</rss>

