<?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 convert SAS Date to a String? in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8454#M825</link>
    <description>Suggestion: you need not post in more than one SAS discussion forum.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Wed, 28 Oct 2009 03:52:12 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-10-28T03:52:12Z</dc:date>
    <item>
      <title>How to convert SAS Date to a String?</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8453#M824</link>
      <description>I have a column named "EffectiveDate". I want to check for a record that has an EffectiveDate of "01-01-2010", then this record need to be removed. I don't know how to compare since the EffectiveDate is formated in Date type and the values look numerics. Can I use put function to convert the EffectiveDate to string? then I compare it with "01-01-2010". Your inputs are much appreciated.</description>
      <pubDate>Wed, 28 Oct 2009 03:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8453#M824</guid>
      <dc:creator>Lani</dc:creator>
      <dc:date>2009-10-28T03:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS Date to a String?</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8454#M825</link>
      <description>Suggestion: you need not post in more than one SAS discussion forum.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 28 Oct 2009 03:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8454#M825</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-10-28T03:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS Date to a String?</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8455#M826</link>
      <description>Hi Lani,&lt;BR /&gt;
&lt;BR /&gt;
Yes, you can convert "Effective Date" variable into charracter variable. Then you can compare.</description>
      <pubDate>Thu, 10 Dec 2009 06:51:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8455#M826</guid>
      <dc:creator>SSN_Ravi</dc:creator>
      <dc:date>2009-12-10T06:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert SAS Date to a String?</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8456#M827</link>
      <description>Hi:&lt;BR /&gt;
  In addition to converting the variable, you can also use Date constants to perform your selection or your deletion in a DATA step program (or PROC SQL step):&lt;BR /&gt;
[pre]&lt;BR /&gt;
  if EffectiveDate = '01JAN2010'd then delete;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
The date constant form 'DDMMMYYYY'D or 'DDMMMYY'D allows you to supply a date in "readable" format and the D at the end of the constant tells SAS to convert that value to an internal date value, so it would be as though you were specifying this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  if EffectiveDate = 18263 then delete;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
          &lt;BR /&gt;
because '01jan2010'D is the date constant way to specify 18263 -- which represents January 1, 2010, which will be 18,263 days from Jan 1, 1960.&lt;BR /&gt;
&lt;BR /&gt;
If EffectiveDate was a DATE/TIME variable, then you might have to use a different function to specify your comparison...something like:&lt;BR /&gt;
                                  &lt;BR /&gt;
[pre]&lt;BR /&gt;
  if datepart(EffectiveDate) = '01jan2010'd then delete;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                          &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 10 Dec 2009 20:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/How-to-convert-SAS-Date-to-a-String/m-p/8456#M827</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-12-10T20:45:08Z</dc:date>
    </item>
  </channel>
</rss>

