<?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 Formatting  a date question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168716#M43645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having problems reading the date on my sas table&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01sept10 000000&lt;/P&gt;&lt;P&gt;the date is september 1 2010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ive tried to read this date and produce results like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;id&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; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expiry &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&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; 01sept10 000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by using a code like this&lt;/P&gt;&lt;P&gt;length expiry $ 10&lt;/P&gt;&lt;P&gt;if date &amp;lt; '21Apr2014' d then expiry ='yes'; , the problem is the code does not appear to recognize this date format and give incorrect results. I was thinking that the solution may be&amp;nbsp; to change the format of the date to something like 01/09/2010 as this format has worked for me in the past. How do i change the code or which is the quickest way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Oct 2014 19:15:11 GMT</pubDate>
    <dc:creator>zetter</dc:creator>
    <dc:date>2014-10-01T19:15:11Z</dc:date>
    <item>
      <title>Formatting  a date question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168716#M43645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having problems reading the date on my sas table&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01sept10 000000&lt;/P&gt;&lt;P&gt;the date is september 1 2010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ive tried to read this date and produce results like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;id&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; 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expiry &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&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; 01sept10 000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by using a code like this&lt;/P&gt;&lt;P&gt;length expiry $ 10&lt;/P&gt;&lt;P&gt;if date &amp;lt; '21Apr2014' d then expiry ='yes'; , the problem is the code does not appear to recognize this date format and give incorrect results. I was thinking that the solution may be&amp;nbsp; to change the format of the date to something like 01/09/2010 as this format has worked for me in the past. How do i change the code or which is the quickest way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 19:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168716#M43645</guid>
      <dc:creator>zetter</dc:creator>
      <dc:date>2014-10-01T19:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting  a date question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168717#M43646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're dealing with an actual SAS dataset post the proc contents on it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=have; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My guess is its a date time variable so you'll need to use the date part function for the comparison:&lt;/P&gt;&lt;P&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 datepart(date) &amp;lt; '21Apr2014' d then expiry ='yes';&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 19:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168717#M43646</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-01T19:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting  a date question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168718#M43647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks this works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 17:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168718#M43647</guid>
      <dc:creator>zetter</dc:creator>
      <dc:date>2014-10-02T17:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting  a date question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168719#M43648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks that works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Oct 2014 19:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Formatting-a-date-question/m-p/168719#M43648</guid>
      <dc:creator>zetter</dc:creator>
      <dc:date>2014-10-02T19:34:19Z</dc:date>
    </item>
  </channel>
</rss>

