<?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 SAS dates question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-dates-question/m-p/41805#M10833</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much! I was going crazy for three days straight. Now I can breath again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again. You're awesome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 24 Mar 2012 20:19:35 GMT</pubDate>
    <dc:creator>Dezod</dc:creator>
    <dc:date>2012-03-24T20:19:35Z</dc:date>
    <item>
      <title>SAS dates question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-dates-question/m-p/41803#M10831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm new to sas, my teacher gave us a data set and he asked us to set scheduled dates to the last of the month if the initial visit dat was on the last of the month. I have been going crazy for 3 days now and I can't figure it out. Any help would be appreciated. Thank you. I am uploading the files so you can see what I'm dealing with.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 17:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-dates-question/m-p/41803#M10831</guid>
      <dc:creator>Dezod</dc:creator>
      <dc:date>2012-03-23T17:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: SAS dates question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-dates-question/m-p/41804#M10832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am always reluctant to do someone's homework, since I believe that part of education is learning how to do things on your own by doing homework. However, I am always happy to provide an example that may point you in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; First, I'm not entirely sure what you mean when you say that you need to "set scheduled dates to the last of the month if the initial visit dat was on the last of the month". But it sounds like you need to calculate an interval by taking a date that you need to "start from" and then find out what some date is, given a known interval. So, for example, let's say that I have this data:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;LAST&amp;nbsp; FIRST&amp;nbsp;&amp;nbsp; VISIT_DATE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Allen Andy&amp;nbsp;&amp;nbsp;&amp;nbsp; 03/31/2009&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Bond Bobby&amp;nbsp;&amp;nbsp;&amp;nbsp; 12/29/2010&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Chase Candy&amp;nbsp;&amp;nbsp; 07/25/2001&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Davis Dan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/30/1983&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Edwards Eliza 03/24/2012&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and, as you can see, some of the visit dates fall on the last day of the month and some of the dates do NOT fall on the last day of the month. I can use the INTNX function to create a new variable that will be the last day of the "same" month or the last day of the "next" month. The documentation for the INTNX function outlines the arguments and intervals that you can use. In my example, I calculate two new variables. You should be able to run the attached program and review the output. Between that and consulting the documentation, I think you may find the INTNX function to be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;data fakedata;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; infile datalines dlm=' ' ;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; input last_name $ first_name $ visit_date : mmddyy10.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; end_of_same_month = intnx('month',visit_date,0,'e');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; end_of_next_month = intnx('month',visit_date,1,'e');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;return;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Allen Andy&amp;nbsp;&amp;nbsp;&amp;nbsp; 03/31/2009&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Bond Bobby&amp;nbsp;&amp;nbsp;&amp;nbsp; 12/29/2010&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Chase Candy&amp;nbsp;&amp;nbsp; 07/25/2001&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Davis Dan&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/30/1983&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;Edwards Eliza 03/24/2012&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods listing;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc print data=fakedata;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; var last_name first_name visit_date end_of_same_month end_of_next_month;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; format end_of_same_month end_of_next_month visit_date mmddyy10.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 19:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-dates-question/m-p/41804#M10832</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-03-23T19:50:30Z</dc:date>
    </item>
    <item>
      <title>SAS dates question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-dates-question/m-p/41805#M10833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much! I was going crazy for three days straight. Now I can breath again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again. You're awesome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Mar 2012 20:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-dates-question/m-p/41805#M10833</guid>
      <dc:creator>Dezod</dc:creator>
      <dc:date>2012-03-24T20:19:35Z</dc:date>
    </item>
  </channel>
</rss>

