<?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: Comparing dates with if statment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338632#M77154</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/129889"&gt;@Curly&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would imagine this would work, but that is not the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please and thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does that mean? How did it not work?&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 01:05:38 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-03-07T01:05:38Z</dc:date>
    <item>
      <title>Comparing dates with if statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338623#M77147</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still pretty new to sas.&lt;/P&gt;&lt;P&gt;Here is the situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table (Merged1) that has IDnumbers some descriptions and 2 dates, an event date and a consent date. both of the dates are in the format MMDDYY10 and each row has all these variables.&lt;/P&gt;&lt;P&gt;I want to get a data set where the consent date is before the event date. So if an even happened before the consent it will not be in my new data set. I have something like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Sample1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set merged_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where event_date &amp;gt; consent_date;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that dates are just numbers counting from a certain date, so I would imagine this would work, but that is not the case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please and thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 00:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338623#M77147</guid>
      <dc:creator>Curly</dc:creator>
      <dc:date>2017-03-07T00:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing dates with if statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338624#M77148</link>
      <description>&lt;P&gt;Make sure (proc contents) that the date variables are numeric with a MMDDYY10. assigned.&lt;/P&gt;
&lt;P&gt;If that is the case, post some examples that illustrate your issues in a data step with datalines.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 00:32:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338624#M77148</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-07T00:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing dates with if statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338632#M77154</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/129889"&gt;@Curly&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would imagine this would work, but that is not the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please and thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does that mean? How did it not work?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 01:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338632#M77154</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-07T01:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing dates with if statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338664#M77168</link>
      <description>&lt;P&gt;If your two dates are just character strings that look like dates, just change your code to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data Sample1;
    set merged_data;
    if input(event_date,mmddyy10.) &amp;gt; input(consent_date,mmddyy10.);
run;
&lt;/PRE&gt;
&lt;P&gt;HTH,&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 03:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338664#M77168</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-07T03:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing dates with if statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338867#M77255</link>
      <description>&lt;P&gt;Example data.&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 16:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338867#M77255</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-07T16:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing dates with if statment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338892#M77265</link>
      <description>&lt;P&gt;You need to look into the descriptor portion about how the dates are formated. Use PROC CONTENTS and see weather the dates are char or num and use appropriate method as mentioned by others.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 16:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Comparing-dates-with-if-statment/m-p/338892#M77265</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2017-03-07T16:37:38Z</dc:date>
    </item>
  </channel>
</rss>

