<?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: Reading DOB data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233173#M12290</link>
    <description>&lt;P&gt;The program that you have is a good match for the data you have shown.&amp;nbsp; You would run into a problem if your program were different.&amp;nbsp; for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input dob $10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That would read in the extra character that you are seeing.&amp;nbsp; But this would be fine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length dob $ 10;&lt;/P&gt;
&lt;P&gt;input dob $;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another place you could go wrong is by adding an informat:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;informat dob $10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But what you have posted is a good match and should be working.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2015 20:32:09 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2015-11-04T20:32:09Z</dc:date>
    <item>
      <title>Reading DOB data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233158#M12283</link>
      <description>&lt;P&gt;I have DOB values, some of which look like this: &amp;nbsp;&amp;nbsp;9/23/1996 &amp;nbsp;12:00:00 AM &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Others are like this: &amp;nbsp;3/1/1998 &amp;nbsp;12:00:00 AM&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the length statement dob $10 works for the first one but not the 2nd. Instead, I get 3/1/1998 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want is just the date:&lt;/P&gt;
&lt;P&gt;9/23/1996&lt;/P&gt;
&lt;P&gt;3/1/1998&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 20:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233158#M12283</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2015-11-04T20:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading DOB data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233160#M12284</link>
      <description>You don't say if you want the time as well but to read the date I would start with an informat of ANYDTDTE. and then assign the mmddyy10. format for use. This way you will have an actual date that can be manipulated with many functions instead of a not very nice character value.</description>
      <pubDate>Wed, 04 Nov 2015 20:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233160#M12284</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-11-04T20:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reading DOB data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233162#M12285</link>
      <description>i want just the date.</description>
      <pubDate>Wed, 04 Nov 2015 20:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233162#M12285</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2015-11-04T20:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Reading DOB data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233166#M12286</link>
      <description>Try anydtDTM for a date time variable. Then use the Datepart function to get only the date specific portion.</description>
      <pubDate>Wed, 04 Nov 2015 20:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233166#M12286</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-11-04T20:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reading DOB data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233168#M12287</link>
      <description>&lt;P&gt;data have;&lt;BR /&gt;infile datalines truncover;&lt;BR /&gt;input cdate $30.;&lt;BR /&gt;datalines;&lt;BR /&gt;&amp;nbsp;9/23/1996&amp;nbsp; 12:00:00 AM &amp;nbsp;&lt;BR /&gt;3/1/1998&amp;nbsp; 12:00:00 AM&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;date = input(scan(cdate,1,' '),anydtdte.);&lt;BR /&gt;format date date9.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 20:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233168#M12287</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2015-11-04T20:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading DOB data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233169#M12288</link>
      <description>&lt;P&gt;I think I may have to forget the data step I'm using. The files I'm reading have changed from last year. &amp;nbsp;Right now I have:&lt;/P&gt;
&lt;P&gt;data student;&lt;/P&gt;
&lt;P&gt;length dob $10 .................;&lt;/P&gt;
&lt;P&gt;infile '.........';&lt;/P&gt;
&lt;P&gt;input dob $;&lt;/P&gt;
&lt;P&gt;new_dob=input(dob,yymmdd10.);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 20:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233169#M12288</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2015-11-04T20:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reading DOB data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233172#M12289</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data student;
infile '.........';
informat dob AnyDtDTE. ;
input dob ;
Format dob mmddyy10. ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and see if that work. I have a number of files where the data source appends a spurious "time" that I ignore by reading just the date part using similar code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 20:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233172#M12289</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-11-04T20:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading DOB data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233173#M12290</link>
      <description>&lt;P&gt;The program that you have is a good match for the data you have shown.&amp;nbsp; You would run into a problem if your program were different.&amp;nbsp; for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input dob $10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That would read in the extra character that you are seeing.&amp;nbsp; But this would be fine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;length dob $ 10;&lt;/P&gt;
&lt;P&gt;input dob $;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another place you could go wrong is by adding an informat:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;informat dob $10.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But what you have posted is a good match and should be working.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2015 20:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Reading-DOB-data/m-p/233173#M12290</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-11-04T20:32:09Z</dc:date>
    </item>
  </channel>
</rss>

