<?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: Can someone help re: if date= &amp;quot;Friday&amp;quot; then put 'Today is =' date; because it's not wo in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-help-re-if-date-quot-Friday-quot-then-put-Today-is/m-p/719932#M222962</link>
    <description>&lt;P&gt;A format controls how a value displays, not what to test for equality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to test a formatted value the you would use Put(variable, formatname.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a value is a date then the easiest way to check if date is a specific day of the week is to use the WEEKDAY function.&lt;/P&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;DIV class="xis-details"&gt;
&lt;DIV id="n0rhd0odxny55jn17o5mndcw2zz1" class="xis-topicContent"&gt;
&lt;DIV id="n1n6j6jqoydh0kn1suc9mqqdue3l" class="xis-paragraph"&gt;The WEEKDAY function produces an integer that represents the day of the week, where 1=Sunday, 2=Monday, ..., 7=Saturday.&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;So you would use&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;if weekday(date) = 7 then &amp;lt;do what ever when "friday"&amp;gt;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2021 15:12:45 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-02-17T15:12:45Z</dc:date>
    <item>
      <title>Can someone help re: if date= "Friday" then put 'Today is =' date; because it's not working.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-help-re-if-date-quot-Friday-quot-then-put-Today-is/m-p/719925#M222961</link>
      <description>&lt;P&gt;SAS Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date=today()-5; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Format Date DOWNAME.;&lt;/P&gt;&lt;P&gt;put "date=" date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is working and the code has output date as Friday&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT, the code: &amp;nbsp;if date= "Friday" then put 'Today is =' date; is not working. Can someone help?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 15:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-someone-help-re-if-date-quot-Friday-quot-then-put-Today-is/m-p/719925#M222961</guid>
      <dc:creator>KAMP</dc:creator>
      <dc:date>2021-02-17T15:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone help re: if date= "Friday" then put 'Today is =' date; because it's not wo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-help-re-if-date-quot-Friday-quot-then-put-Today-is/m-p/719932#M222962</link>
      <description>&lt;P&gt;A format controls how a value displays, not what to test for equality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to test a formatted value the you would use Put(variable, formatname.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a value is a date then the easiest way to check if date is a specific day of the week is to use the WEEKDAY function.&lt;/P&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;DIV class="xis-details"&gt;
&lt;DIV id="n0rhd0odxny55jn17o5mndcw2zz1" class="xis-topicContent"&gt;
&lt;DIV id="n1n6j6jqoydh0kn1suc9mqqdue3l" class="xis-paragraph"&gt;The WEEKDAY function produces an integer that represents the day of the week, where 1=Sunday, 2=Monday, ..., 7=Saturday.&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;So you would use&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;if weekday(date) = 7 then &amp;lt;do what ever when "friday"&amp;gt;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-paragraph"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 15:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-someone-help-re-if-date-quot-Friday-quot-then-put-Today-is/m-p/719932#M222962</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-17T15:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone help re: if date= "Friday" then put 'Today is =' date; because it's not wo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-someone-help-re-if-date-quot-Friday-quot-then-put-Today-is/m-p/719936#M222964</link>
      <description>Thanks a lot. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 17 Feb 2021 15:19:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-someone-help-re-if-date-quot-Friday-quot-then-put-Today-is/m-p/719936#M222964</guid>
      <dc:creator>KAMP</dc:creator>
      <dc:date>2021-02-17T15:19:40Z</dc:date>
    </item>
  </channel>
</rss>

