<?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: Convert text dates and see if two dates are the same in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-text-dates-and-see-if-two-dates-are-the-same/m-p/363303#M86006</link>
    <description>&lt;P&gt;You don't have to convert the to dates to check if they're equal if they look the same. You can check directly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest using an INFORMAT to specify the format type - yymmdd8 and then format the date with a date9 format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some skeleton code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
informat idat edat trtdat yymmdd8.;
format idat edat trtdat date9.;
input idat edit trtdat;

if idat = trtdat then do;

****whateever you want to do here*****;

end;


run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Jun 2017 03:34:02 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-06-01T03:34:02Z</dc:date>
    <item>
      <title>Convert text dates and see if two dates are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-text-dates-and-see-if-two-dates-are-the-same/m-p/363289#M86001</link>
      <description>&lt;P&gt;Good Evening,&lt;/P&gt;&lt;P&gt;im reading in an input file that has dates in text format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IDAT&lt;/STRONG&gt; $ EDAT $ &lt;STRONG&gt;TRDAT $&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Idat and TRDat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both look similar to&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#ffffff" face="Calibri" size="3"&gt;Idate&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;&lt;FONT color="#ffffff" face="Calibri" size="3"&gt;trdate&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;20170426&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;20170426&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my goal is to compare if the date are identical or not.(1 or 0)&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2017 02:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-text-dates-and-see-if-two-dates-are-the-same/m-p/363289#M86001</guid>
      <dc:creator>Bellefeuille</dc:creator>
      <dc:date>2017-06-01T02:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text dates and see if two dates are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-text-dates-and-see-if-two-dates-are-the-same/m-p/363303#M86006</link>
      <description>&lt;P&gt;You don't have to convert the to dates to check if they're equal if they look the same. You can check directly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest using an INFORMAT to specify the format type - yymmdd8 and then format the date with a date9 format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some skeleton code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
informat idat edat trtdat yymmdd8.;
format idat edat trtdat date9.;
input idat edit trtdat;

if idat = trtdat then do;

****whateever you want to do here*****;

end;


run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 03:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-text-dates-and-see-if-two-dates-are-the-same/m-p/363303#M86006</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-01T03:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert text dates and see if two dates are the same</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-text-dates-and-see-if-two-dates-are-the-same/m-p/363341#M86025</link>
      <description>&lt;P&gt;You have two text strings therefore:&lt;/P&gt;
&lt;PRE&gt;identical=ifc(strip(edat)=strip(trtdat),1,0);&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jun 2017 08:21:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-text-dates-and-see-if-two-dates-are-the-same/m-p/363341#M86025</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-01T08:21:14Z</dc:date>
    </item>
  </channel>
</rss>

