<?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: Date Format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506223#M135669</link>
    <description>&lt;P&gt;Thank you for the help. Would you be able to do this problem without using the catx statement?&lt;/P&gt;</description>
    <pubDate>Sat, 20 Oct 2018 13:33:06 GMT</pubDate>
    <dc:creator>paperboy22</dc:creator>
    <dc:date>2018-10-20T13:33:06Z</dc:date>
    <item>
      <title>Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506174#M135645</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am having trouble reading in the dates for this problem. I keep getting the wrong dates read in for some observations, and missing values for the rest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For the first report&lt;/STRONG&gt;&lt;SPAN&gt;, you need to determine on what date the patients' next appointment should fall. If, at the last appointment, a patient is 45 or less, she should be seen again in (exactly) two years. If a patient is older than 45, she should be seen again in (exactly) one year. For the report, simply print the patient's name, their last appointment date, their age, and the next appointment date. (Suppress the printing of the observation number.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is the data for the problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="textLayer--absolute"&gt;Jane Smith 10/25/1985 06/15/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Laura Smellner 10/20/1947 06/17/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Jenna Jones 10/23/1964 07/01/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Beth Bonders 10/26/1939 07/14/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Grace Johson 10/19/1958 07/29/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Mary Contrary 10/22/1981 06/30/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Jennifer Palermo 10/21/1953 09/03/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Ann Lewis 10/24/1975 08/15/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Linda Bentner 10/13/1938 09/04/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Francine Scalia 10/14/1963 09/04/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Leah Thill 10/15/1949 08/01/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Caroline Harris 10/16/1968 08/11/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Olivia Knupf 10/17/1972 07/31/2010&lt;/DIV&gt;&lt;DIV class="textLayer--absolute"&gt;Maya Angelson 10/18/1961 07/17/2010&lt;/DIV&gt;</description>
      <pubDate>Fri, 19 Oct 2018 21:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506174#M135645</guid>
      <dc:creator>paperboy22</dc:creator>
      <dc:date>2018-10-19T21:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506182#M135648</link>
      <description>&lt;P&gt;Please post your code.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 22:20:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506182#M135648</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-10-19T22:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506190#M135651</link>
      <description>&lt;P&gt;OPTIONS PS=58 LS=72 NODATE NONUMBER;&lt;BR /&gt;LIBNAME stat481 'C:\stat481\data';&lt;BR /&gt;DATA scheduling (drop=bdate);&lt;BR /&gt;input patient &amp;amp; $16. bdate mmddyy10. lastappt;&lt;BR /&gt;age= lastappt-bdate;&lt;BR /&gt;format lastappt mmddyy10.;&lt;BR /&gt;DATALINES;&lt;BR /&gt;Jane Smith 10/25/1985 06/15/2010&lt;BR /&gt;Laura Smellner 10/20/1947 06/17/2010&lt;BR /&gt;Jenna Jones 10/23/1964 07/01/2010&lt;BR /&gt;Beth Bonders 10/26/1939 07/14/2010&lt;BR /&gt;Grace Johson 10/19/1958 07/29/2010&lt;BR /&gt;Mary Contrary 10/22/1981 06/30/2010&lt;BR /&gt;Jennifer Palermo 10/21/1953 09/03/2010&lt;BR /&gt;Ann Lewis 10/24/1975 08/15/2010&lt;BR /&gt;Linda Bentner 10/13/1938 09/04/2010&lt;BR /&gt;Francine Scalia 10/14/1963 09/04/2010&lt;BR /&gt;Leah Thill 10/15/1949 08/01/2010&lt;BR /&gt;Caroline Harris 10/16/1968 08/11/2010&lt;BR /&gt;Olivia Knupf 10/17/1972 07/31/2010&lt;BR /&gt;Maya Angelson 10/18/1961 07/17/2010&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;PROC PRINT Data=scheduling NOOBS;&lt;BR /&gt;Title 'Scheduling';&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my output:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scheduling&lt;/P&gt;&lt;P&gt;patient lastappt age&lt;/P&gt;&lt;P&gt;Jane Smith . .&lt;BR /&gt;Laura Smellner 01/08/1960 .&lt;BR /&gt;Jenna Jones 05/18/1965 .&lt;BR /&gt;Beth Bonders 07/28/1962 -14335&lt;BR /&gt;Grace Johson 08/16/1962 -14309&lt;BR /&gt;Mary Contrary 03/22/1960 -21763&lt;BR /&gt;Jennifer Palermo . .&lt;BR /&gt;Linda Bentner 02/08/1960 -21797&lt;BR /&gt;Francine Scalia . .&lt;BR /&gt;Leah Thill . .&lt;BR /&gt;Caroline Harris . .&lt;BR /&gt;Olivia Knupf 08/30/1962 -14293&lt;BR /&gt;Maya Angelson 03/02/1960 -21779&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 23:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506190#M135651</guid>
      <dc:creator>paperboy22</dc:creator>
      <dc:date>2018-10-19T23:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506212#M135662</link>
      <description>&lt;P&gt;Change your input statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input patient :$20. _patient :$10. bdate :mmddyy10. lastappt :mmddyy10.;
patient = catx(' ',patient,_patient);
drop _patient;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Assign proper formats for both date variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 08:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506212#M135662</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-20T08:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506222#M135668</link>
      <description>&lt;P&gt;Here's the simplest way that I can think of, to read in the data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data scheduling (drop=bdate);&lt;/P&gt;
&lt;P&gt;informat bdate lastappt mmddyy10.;&lt;/P&gt;
&lt;P&gt;format bdate lastappt mmddyy10.;&lt;/P&gt;
&lt;P&gt;input fname $ lname $ bdate lastappt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Continuing the same DATA step, you would need a formula to calculate age in years.&amp;nbsp; While there are more precise methods, here is an easy approximation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;age = (lastapp - bdate) / 365.25;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, you will need to set up some logic to determine the next appointment, based on age.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 13:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506222#M135668</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-20T13:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506223#M135669</link>
      <description>&lt;P&gt;Thank you for the help. Would you be able to do this problem without using the catx statement?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 13:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506223#M135669</guid>
      <dc:creator>paperboy22</dc:creator>
      <dc:date>2018-10-20T13:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506224#M135670</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/241317"&gt;@paperboy22&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for the help. Would you be able to do this problem without using the catx statement?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why?&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 13:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Format/m-p/506224#M135670</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-20T13:56:47Z</dc:date>
    </item>
  </channel>
</rss>

