<?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 find a date interval with a specific days in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920813#M362666</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464333"&gt;@Mazi&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp; I wish to find those dates that "if event_date is within 60days after the end_date. Those are the id of interest. Any event date that is more than 60 days after the end date is not of interest.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Mar 2024 19:00:42 GMT</pubDate>
    <dc:creator>CathyVI</dc:creator>
    <dc:date>2024-03-18T19:00:42Z</dc:date>
    <item>
      <title>How to find a date interval with a specific days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920802#M362659</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to&amp;nbsp;determine whether an individual completed any form (event_date) within 60 days of their program (end_date).&lt;/P&gt;&lt;P&gt;I have a demo data below and am struggle with the code. Any help please.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data A;
input ssn @4 start_date :date9. @14 end_date :date9. @24 event_date :date9. ;
infile datalines  firstobs=2 ;
informat start_date end_date event_date date9.;
format start_date end_date event_date date9.;
datalines;
id    start_date	    end_date	 event_date   
101 01DEC2021	28FEB2022	09NOV2020    
101 16OCT2019	18NOV2019	03FEB2020    
102 16OCT2019	18NOV2019	07MAY2020    
103 03FEB2022	02MAY2022	08JUL2022    
103 03FEB2022	12FEB2022	15JAN2023    
;;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;For example, id 101 first end_date was &lt;CODE class=""&gt;28FEB2022&lt;/CODE&gt; but the event date was less than 60days there the first id will not be my desired output.&lt;/P&gt;&lt;P&gt;BUT id 101 second end_date was &lt;CODE class=""&gt;18NOV2019&lt;/CODE&gt;but the event date is 60days more than the end_date therefore the second ID will be part of my desired output. I don't want to dedup any data by id so I can capture all multiple events within one person(id).&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 18:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920802#M362659</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-03-18T18:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a date interval with a specific days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920808#M362663</link>
      <description>&lt;P&gt;Do you mean like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set A;
  where end_date+60 &amp;lt; event_date;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 18:40:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920808#M362663</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-03-18T18:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a date interval with a specific days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920809#M362664</link>
      <description>&lt;P&gt;Do you wish to calculate the difference between the event date and end date?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 18:41:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920809#M362664</guid>
      <dc:creator>Mazi</dc:creator>
      <dc:date>2024-03-18T18:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a date interval with a specific days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920813#M362666</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464333"&gt;@Mazi&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp; I wish to find those dates that "if event_date is within 60days after the end_date. Those are the id of interest. Any event date that is more than 60 days after the end date is not of interest.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 19:00:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920813#M362666</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-03-18T19:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a date interval with a specific days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920817#M362669</link>
      <description>The second ID is more than 60 days after the event date. In your first post you said you’d want this record in your output.&lt;BR /&gt;&lt;BR /&gt;Or am I missing something ?</description>
      <pubDate>Mon, 18 Mar 2024 19:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920817#M362669</guid>
      <dc:creator>Mazi</dc:creator>
      <dc:date>2024-03-18T19:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a date interval with a specific days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920820#M362672</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/464333"&gt;@Mazi&lt;/a&gt;&amp;nbsp; if you have 60days to the enddate (enddate+60) and the results is within the event_date, thats what I want. If you add 60 to the enddate and the results is more, I want a separate output of it.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 19:30:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920820#M362672</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2024-03-18T19:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a date interval with a specific days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920822#M362674</link>
      <description>Data want;&lt;BR /&gt;set a;&lt;BR /&gt;diff = event_date - end_date;&lt;BR /&gt;If 0&amp;lt;=diff&amp;lt;=60 then flag = 1;&lt;BR /&gt;else if diff &amp;gt;60 then flag= 2;&lt;BR /&gt;run;</description>
      <pubDate>Mon, 18 Mar 2024 19:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920822#M362674</guid>
      <dc:creator>Mazi</dc:creator>
      <dc:date>2024-03-18T19:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a date interval with a specific days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920825#M362676</link>
      <description>If flag = 1 then event_date is 60 days or less after end_date&lt;BR /&gt;&lt;BR /&gt;If flag = 2 then event_date is more than 60 days after end_date</description>
      <pubDate>Mon, 18 Mar 2024 19:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-a-date-interval-with-a-specific-days/m-p/920825#M362676</guid>
      <dc:creator>Mazi</dc:creator>
      <dc:date>2024-03-18T19:38:22Z</dc:date>
    </item>
  </channel>
</rss>

