<?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: Extract Day of Week name from a Time Stamp field in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474514#M30778</link>
    <description>&lt;P&gt;Ok try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CASE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WHEN&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;upcase(put(datepart(t1.arrdate),DOWNAME9.))&lt;/STRONG&gt;&lt;/EM&gt;='MONDAY' THEN 7&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;END&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the above works. please repeat for all other when conditions as well&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jun 2018 17:30:55 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-06-29T17:30:55Z</dc:date>
    <item>
      <title>Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474448#M30765</link>
      <description>&lt;P&gt;I have a timestamp field that displays as DDMMMYYYY:HH:MM:SS.&amp;nbsp; I need to get to the day of the week (Monday, Tuesday, etc) for this field.&amp;nbsp; When I insert a computed field and simply try to format this field as DOWNAME9., I get a return of&amp;nbsp;*********.&amp;nbsp; Can someone point me to a solution for this?&amp;nbsp; Keep in mind that I am using the Enterprise Guide query builder and have no experience with coding.&lt;BR /&gt;I appreciate any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rita Yee&lt;/P&gt;&lt;P&gt;Project Engineer&lt;/P&gt;&lt;P&gt;FedEx Express&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 14:28:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474448#M30765</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2018-06-29T14:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474452#M30766</link>
      <description>&lt;P&gt;you want to create a variable that is datepart(timestamp)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and then the DOWNAME9. format should work&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 14:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474452#M30766</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-29T14:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474453#M30767</link>
      <description>&lt;P&gt;will this help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
var=datetime();/*today's datetime value for example*/
dayofweek=put(datepart(var),weekdate9. -l);
format var datetime20.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jun 2018 14:35:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474453#M30767</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-29T14:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474456#M30768</link>
      <description>&lt;P&gt;Thanks so much.&amp;nbsp; I just had a "blonde moment" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; I'm still trying to figure out where and when to just reformat versus when to apply a function before formatting.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 14:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474456#M30768</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2018-06-29T14:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474477#M30769</link>
      <description>&lt;P&gt;Hi again Paige,&lt;/P&gt;&lt;P&gt;So, I'm getting what I wanted in the way of the weekday name, but I still have an issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This computed column is DayName and is shown as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datepart(t1.arrdate)&lt;/STRONG&gt;&amp;nbsp; which is formatted to DOWNAME9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After this step, I want to use DayName to determine way the data is grouped.&amp;nbsp; (This is hard to explain)&amp;nbsp; In short,&amp;nbsp; I assign numbers to the days based on their name (1-7).&amp;nbsp; I change the order in which they are assigned based on the day an issue happened.&amp;nbsp; So, if we had an issue on Tuesday, Tuesday would be assigned 1, Wednesday would be 2, Thursday is 3, until Monday becomes 7.&amp;nbsp; The reasoning is that I have&amp;nbsp;4 weeks worth of data and I want like-days grouped together.&amp;nbsp; In this scenario,&amp;nbsp; all 4 Tuesdays will be grouped together in the outcome.&amp;nbsp; That way, I can compare the day of the issue (Current Tuesday) with the previous three Tuesdays.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code in the computed column is:&lt;/P&gt;&lt;P&gt;CASE&lt;BR /&gt;WHEN (datepart(t1.arrdate))='MONDAY' THEN 7&lt;BR /&gt;WHEN (datepart(t1.arrdate))='TUESDAY' THEN 1&lt;BR /&gt;WHEN (datepart(t1.arrdate))='WEDNESDAY' THEN 2&lt;BR /&gt;WHEN (datepart(t1.arrdate))='THURSDAY' THEN 3&lt;BR /&gt;WHEN (datepart(t1.arrdate))='FRIDAY' THEN 4&lt;BR /&gt;WHEN (datepart(t1.arrdate))='SATURDAY' THEN 5&lt;BR /&gt;ELSE 6&lt;BR /&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When trying to create the computed column,&amp;nbsp;I get&amp;nbsp;the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Keep in mind that I am migrating a program previously written for Hyperion.&amp;nbsp; There may be an easier way to do this in SAS.&amp;nbsp; I'm too new to really know all that is available at this point.&amp;nbsp; I only use the designer in Enterprise Guide, too, so that may have limitations.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 15:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474477#M30769</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2018-06-29T15:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474479#M30770</link>
      <description>&lt;P&gt;Thanks for the help.&amp;nbsp; Paige reminded me of what I'd missed &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; I posted another issue here, so if you have any suggestions for my problem, I'm open!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 15:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474479#M30770</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2018-06-29T15:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474483#M30771</link>
      <description>&lt;P&gt;&lt;SPAN&gt;WHEN WEEKDAY(datepart(t1.arrdate))=2 THEN 7&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;See the documentation for the WEEKDAY function&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0ahi8tk3trkv5n173sil9hd7c62.htm&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0ahi8tk3trkv5n173sil9hd7c62.htm&amp;amp;locale=en&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 16:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474483#M30771</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-29T16:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474507#M30774</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;The fact that I ask for help simply means I am inexperienced and under-educated. Please don't assume I am incompetent and uneducated."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I love that line. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; Did anybody assume so ? I would like to meet that Einstein&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 17:21:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474507#M30774</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-29T17:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474510#M30775</link>
      <description>&lt;P&gt;This helped me with another issue... how to comment inside the code for my computed field.&amp;nbsp; &amp;nbsp;THANKS &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 17:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474510#M30775</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2018-06-29T17:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474512#M30777</link>
      <description>&lt;P&gt;I've run into a few condescending derrieres here. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 17:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474512#M30777</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2018-06-29T17:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Day of Week name from a Time Stamp field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474514#M30778</link>
      <description>&lt;P&gt;Ok try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CASE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;WHEN&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;upcase(put(datepart(t1.arrdate),DOWNAME9.))&lt;/STRONG&gt;&lt;/EM&gt;='MONDAY' THEN 7&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;END&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If the above works. please repeat for all other when conditions as well&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 17:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Extract-Day-of-Week-name-from-a-Time-Stamp-field/m-p/474514#M30778</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-06-29T17:30:55Z</dc:date>
    </item>
  </channel>
</rss>

