<?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: How to find date of week in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421020#M67944</link>
    <description>&lt;P&gt;Hi Gil_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check if this is what you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input id:$2. Schedule:$20. Today:$20.;&lt;BR /&gt;cards;&lt;BR /&gt;A1 MON-TUE WED&lt;BR /&gt;A2 WED-SAT WED&lt;BR /&gt;A3 MON-TUE-WED WED&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;outputs = ifc(index(strip(upcase(Schedule)), strip(upcase(today)))&amp;gt;0, "TRUE", "FALSE");&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Dec 2017 22:58:50 GMT</pubDate>
    <dc:creator>skyvalley81</dc:creator>
    <dc:date>2017-12-13T22:58:50Z</dc:date>
    <item>
      <title>How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421015#M67941</link>
      <description>Hi I have a data set looks like this&lt;BR /&gt;Id. Schedule. Today. Output&lt;BR /&gt;A1. MON TUE. WED. False&lt;BR /&gt;A2. WED SAT. WED. True&lt;BR /&gt;A3. MON TUE WED. WED. TRUE&lt;BR /&gt;&lt;BR /&gt;I need to look in col Today see if it matches in the schedule for True or False</description>
      <pubDate>Wed, 13 Dec 2017 22:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421015#M67941</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-12-13T22:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421016#M67942</link>
      <description>&lt;P&gt;data have;&lt;BR /&gt;input id $ Schedule &amp;amp; $12. Today $;&lt;BR /&gt;datalines;&lt;BR /&gt;A1. MON TUE WED False&lt;BR /&gt;A2. WED SAT WED True&lt;BR /&gt;A3. MON TUE WED WED TRUE&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;if index(STRIP(Schedule),STRIP( today))&amp;gt;0 then output='T';&lt;BR /&gt;ELSE OUTPUT='F';&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;OUTPUT = ifc(INDEX(STRIP(Schedule),STRIP( today))&amp;gt;0, 'T', 'F');&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 22:57:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421016#M67942</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-13T22:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421017#M67943</link>
      <description>&lt;P&gt;Are periods your delimiter?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 22:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421017#M67943</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-13T22:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421020#M67944</link>
      <description>&lt;P&gt;Hi Gil_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check if this is what you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input id:$2. Schedule:$20. Today:$20.;&lt;BR /&gt;cards;&lt;BR /&gt;A1 MON-TUE WED&lt;BR /&gt;A2 WED-SAT WED&lt;BR /&gt;A3 MON-TUE-WED WED&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;outputs = ifc(index(strip(upcase(Schedule)), strip(upcase(today)))&amp;gt;0, "TRUE", "FALSE");&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 22:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421020#M67944</guid>
      <dc:creator>skyvalley81</dc:creator>
      <dc:date>2017-12-13T22:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421022#M67945</link>
      <description>&lt;P&gt;Because you’re looking for words, I’d probably recommend INDEXW or FINDW&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 23:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421022#M67945</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-13T23:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421023#M67946</link>
      <description>HI Reeza, i totally agree these are two alternative options too.</description>
      <pubDate>Wed, 13 Dec 2017 23:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421023#M67946</guid>
      <dc:creator>skyvalley81</dc:creator>
      <dc:date>2017-12-13T23:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421028#M67947</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117620"&gt;@Gil_&lt;/a&gt; wrote:&lt;BR /&gt;Hi I have a data set looks like this&lt;BR /&gt;Id. Schedule. Today. Output&lt;BR /&gt;A1. MON TUE. WED. False&lt;BR /&gt;A2. WED SAT. WED. True&lt;BR /&gt;A3. MON TUE WED. WED. TRUE&lt;BR /&gt;&lt;BR /&gt;I need to look in col Today see if it matches in the schedule for True or False&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Provide what the output is supposed to look like for that example.&lt;/P&gt;
&lt;P&gt;And tell us where your variables start and end. It isn't easy to tell from that example. Be aware, the message windows of this forum reformat text by removing blank characters and possibly other things. If your text as shown above doesn't match what you intended to post, try again by pasting into a code box opened using the forum {I} menu icon. That text box will not reformat text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better is to provide data step code to recreate your data. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 23:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421028#M67947</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-12-13T23:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421286#M67957</link>
      <description>Thanks for responding I put in your code&lt;BR /&gt;Data test4;&lt;BR /&gt;Set test4;&lt;BR /&gt;OUTPUT = ifc(INDEX(STRIP(Schedule),STRIP( today))&amp;gt;0, 'T', 'F');&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The output is F FOR all if the entries&lt;BR /&gt;Today date shows Thu. And schedule has and entry of THU AND OUT PUT IS FALSE SHOULD BE TRUE</description>
      <pubDate>Thu, 14 Dec 2017 18:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421286#M67957</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-12-14T18:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421288#M67958</link>
      <description>&lt;P&gt;Does the full demo code above work?&lt;/P&gt;
&lt;P&gt;If so, there's something different about your dataset that we don't know and can't see.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 18:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421288#M67958</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-14T18:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421332#M67962</link>
      <description>&lt;P&gt;It would be good if you provide it us your data in data step format in order to understand what is going wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reasons that you get incorrect results might be different character cases in the schedule and today variables.&lt;/P&gt;&lt;P&gt;If this is the case you can use the UPCASE function in order to ensure that the variables have the same character cases or the i modifier in the FIND functions. Check the codes below:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output = ifc(index(strip(upcase(schedule)),strip(upcase(today)))&amp;gt;0, 'T', 'F');&lt;BR /&gt;output = ifc(find(strip(schedule),strip(today), "i")&amp;gt;0, 'T', 'F');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also make sure that the variables have the same levels. For example if the schedule variable&amp;nbsp; is MON and the today Monday this code wont work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 20:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421332#M67962</guid>
      <dc:creator>skyvalley81</dc:creator>
      <dc:date>2017-12-14T20:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421730#M67979</link>
      <description>Ok I realized that the Today is a number and schedule is character .. I have&lt;BR /&gt;Data test4;&lt;BR /&gt;Set test4;&lt;BR /&gt;Name=put (today,4.0)&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;To convert today to number I get the sas format of 21E3. I need it to be character to defect Fri&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Dec 2017 23:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421730#M67979</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-12-15T23:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421731#M67980</link>
      <description>To be Text FRI</description>
      <pubDate>Fri, 15 Dec 2017 23:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421731#M67980</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-12-15T23:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421732#M67981</link>
      <description>&lt;P&gt;do you mean your today is a variable that is a numeric sasdate value, if yes-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This may help-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OUTPUT = ifc(INDEX(STRIP(Schedule),STRIP( upcase(put(today, weekdate3.))))&amp;gt;0, 'T', 'F');&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2017 23:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421732#M67981</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-15T23:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421780#M67989</link>
      <description>To answer 1st question yes its a number its formatted Downame3. I inserted your code the error I get is&lt;BR /&gt;&lt;BR /&gt;72-185 the INDEX function call has too many arguments.&lt;BR /&gt;&lt;BR /&gt;Error 71-185 the IFC function call does not have enough arguments</description>
      <pubDate>Sat, 16 Dec 2017 15:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421780#M67989</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-12-16T15:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421783#M67990</link>
      <description>&lt;P&gt;works for me :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data have;&lt;BR /&gt;input id:$2. Schedule:$20.;&lt;BR /&gt;cards;&lt;BR /&gt;A1 MON-TUE WED&lt;BR /&gt;A2 WED-SAT WED&lt;BR /&gt;A3 MON-TUE-FRI WED&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;today=today();&lt;BR /&gt;OUTPUT = ifc(INDEX(STRIP(Schedule),STRIP( upcase(put(today, Downame3.))))&amp;gt;0, 'T', 'F');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may have to show your data to help me understand better.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 17:35:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/421783#M67990</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-12-16T17:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date of week</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/422108#M68011</link>
      <description>Thank you</description>
      <pubDate>Mon, 18 Dec 2017 19:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-find-date-of-week/m-p/422108#M68011</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-12-18T19:37:08Z</dc:date>
    </item>
  </channel>
</rss>

