<?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: SAS date variables function in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151272#M39841</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you haven't imported something incorrectly, a SAS date is a number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can apply a format so that it appears as a date, but the calculations will be correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.lexjansen.com/pharmasug/2005/tutorials/tu01.pdf" title="http://www.lexjansen.com/pharmasug/2005/tutorials/tu01.pdf"&gt;http://www.lexjansen.com/pharmasug/2005/tutorials/tu01.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Sep 2014 21:16:39 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-09-18T21:16:39Z</dc:date>
    <item>
      <title>SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151267#M39836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have a dataset with dates,&lt;/P&gt;&lt;P&gt;the date 07/04/2014 is represented on my sas spreadsheet&amp;nbsp; as 40837.&lt;/P&gt;&lt;P&gt;Now I want to create a variable like this.&lt;/P&gt;&lt;P&gt;Id date of manufacture&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expired?&lt;/P&gt;&lt;P&gt;111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40837&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; an extra column that tells me if manufacture date is suitable &lt;/P&gt;&lt;P&gt;eg if after 28/04/2014 then&amp;nbsp; then date of manufacture is okay, like below&lt;/P&gt;&lt;P&gt;Id date of manufacture&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; suitable?&lt;/P&gt;&lt;P&gt;111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40837&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&lt;/P&gt;&lt;P&gt;I know&amp;nbsp; I&amp;nbsp; can use IF function but don’t know how to use with dates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 19:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151267#M39836</guid>
      <dc:creator>zetter</dc:creator>
      <dc:date>2014-09-18T19:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151268#M39837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input id dom :ddmmyy10. expired :ddmmyy10.;&lt;BR /&gt;if dom&amp;lt;expired then suitable='yes';&lt;BR /&gt;else suitable='no';&lt;BR /&gt;datalines;&lt;BR /&gt;111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 07/04/2014&amp;nbsp; 28/04/2014&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;proc print data=have;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 19:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151268#M39837</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-09-18T19:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151269#M39838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;stat, thanks but my date on sas data is of the format &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.1999998092651px; background-color: #ffffff;"&gt;40837, did you convert to&amp;nbsp; ddmmyy first?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 20:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151269#M39838</guid>
      <dc:creator>zetter</dc:creator>
      <dc:date>2014-09-18T20:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151270#M39839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this is what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input Id dom&amp;nbsp; expired :ddmmyy10.;&lt;BR /&gt;format dom expired ddmmyy10.;&lt;BR /&gt;if dom&amp;lt;expired then suitable='yes';&lt;BR /&gt;else suitable='no';&lt;BR /&gt;datalines;&lt;BR /&gt;111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40837&amp;nbsp; 28/04/2014&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=have;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 20:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151270#M39839</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-09-18T20:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151271#M39840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bet you imported something incorrectly. 40837 in SAS is 22 Oct 2071.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 20:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151271#M39840</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-09-18T20:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151272#M39841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you haven't imported something incorrectly, a SAS date is a number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can apply a format so that it appears as a date, but the calculations will be correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.lexjansen.com/pharmasug/2005/tutorials/tu01.pdf" title="http://www.lexjansen.com/pharmasug/2005/tutorials/tu01.pdf"&gt;http://www.lexjansen.com/pharmasug/2005/tutorials/tu01.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 21:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151272#M39841</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-18T21:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151273#M39842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My date is showing corectly as 4 April 2014 so to create a table with an expired flag but without creating another column with that cufoff date displayed on all my columns per your example,&amp;nbsp; can I put something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data want&lt;/P&gt;&lt;P&gt;Set table&lt;/P&gt;&lt;P&gt;Length date of manufacture $25&lt;/P&gt;&lt;P&gt;If&amp;nbsp;&amp;nbsp; date of manufacture is greater than 28 April 2014 then 'expired' &lt;/P&gt;&lt;P&gt;Run&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will sas recognise 4 April 2014 date, without express ing in a different form?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 10:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151273#M39842</guid>
      <dc:creator>zetter</dc:creator>
      <dc:date>2014-09-19T10:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151274#M39843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, just to clarify, what is a&amp;nbsp; "sas spreadsheet"&amp;nbsp; and what is the 40837?&amp;nbsp; Do you meant that you have an Excel spreadsheet which has dates in, then when you proc import that spreadsheet you get a dataset which has columns with the number in rather than a date?&amp;nbsp; If the numer represents a date then yes, your if should be ok like:&lt;/P&gt;&lt;P&gt;if date_of_manufacture &amp;gt; '28APR2014'd then Result="Expired";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the quotes around the date text and the d.&amp;nbsp; You wouldn't be able to use the text 28 April 2014 directly, you need to process it.&amp;nbsp; Perhaps start by showing some text data and what you want out at the end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 12:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151274#M39843</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-19T12:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151275#M39844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RW9&lt;/P&gt;&lt;P&gt;Ok specifically, this is how my imported data, lets call it work. tablea looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date&lt;/P&gt;&lt;P&gt;111&amp;nbsp;&amp;nbsp; 12/04/2014&lt;/P&gt;&lt;P&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 26/04/2014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to return a table that looks like this, i.e if date is after 20/04/2014 the item has expired if the date is before that then the item has not expired. Results&amp;nbsp; should be shown as follows:&lt;/P&gt;&lt;P style="font-size: 13.1999998092651px;"&gt;id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Expired?&lt;/P&gt;&lt;P style="font-size: 13.1999998092651px;"&gt;111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 12/04/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; no&lt;/P&gt;&lt;P style="font-size: 13.1999998092651px;"&gt;123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24/04/2014&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&lt;/P&gt;&lt;P style="font-size: 13.1999998092651px;"&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 19:04:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151275#M39844</guid>
      <dc:creator>zetter</dc:creator>
      <dc:date>2014-09-19T19:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS date variables function</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151276#M39845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Substitute in your variable names into @RW9 code.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if date&amp;gt; '20APR2014'd then Expired="Yes";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;else Expired="No";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;The first level SAS programming course is available free online here:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A class="active_link" href="https://support.sas.com/edu/schedules.html?ctry=us&amp;amp;id=277"&gt;Programming 1&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 19:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-date-variables-function/m-p/151276#M39845</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-09-19T19:08:44Z</dc:date>
    </item>
  </channel>
</rss>

