<?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 dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426323#M105029</link>
    <description>&lt;P&gt;Assumed that the two variables are actually sas date values (Formatted numeric values), then they are already comparable in the sense that you can compare them with comparison operators in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can make the two dates the same format with a simple format statement like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input date1:yymmdd10. date2:date9.;
format date1 yymmdd10. date2 date9.;
datalines;
19861031 31Oct1986
;

data want;
	set have;
	format date1 date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Jan 2018 07:32:31 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-01-10T07:32:31Z</dc:date>
    <item>
      <title>How to convert dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426298#M105024</link>
      <description>&lt;P&gt;I have dates in two different format. One is 19861031 (YYMMDDN8). and the other&amp;nbsp; 31Oct1986 (DATE9). Can somebody tell me how to make the two dates comparable and in the same format.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 02:09:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426298#M105024</guid>
      <dc:creator>Agent1592</dc:creator>
      <dc:date>2018-01-10T02:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426299#M105025</link>
      <description>&lt;P&gt;Are they different variables or the same variable?&amp;nbsp;What is the type and format of each variable? What are you trying to do with them that makes you think they can't be compared as is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116288"&gt;@Agent1592&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I have dates in two different format. One is 19861031 (YYMMDDN8). and the other&amp;nbsp; 31Oct1986 (DATE9). Can somebody tell me how to make the two dates comparable and in the same format.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 02:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426299#M105025</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-10T02:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426303#M105026</link>
      <description>&lt;P&gt;The dates are already comparable. Since you say that they have date formats, they are SAS dates.&lt;/P&gt;
&lt;P&gt;Just use the format statement to change their format.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 03:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426303#M105026</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-01-10T03:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426323#M105029</link>
      <description>&lt;P&gt;Assumed that the two variables are actually sas date values (Formatted numeric values), then they are already comparable in the sense that you can compare them with comparison operators in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can make the two dates the same format with a simple format statement like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input date1:yymmdd10. date2:date9.;
format date1 yymmdd10. date2 date9.;
datalines;
19861031 31Oct1986
;

data want;
	set have;
	format date1 date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jan 2018 07:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-dates/m-p/426323#M105029</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-01-10T07:32:31Z</dc:date>
    </item>
  </channel>
</rss>

