<?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 convert a string to a date value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/convert-a-string-to-a-date-value/m-p/398197#M96282</link>
    <description>&lt;P&gt;&lt;U&gt;sample data for dob:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;12201999&lt;/P&gt;
&lt;P&gt;01142000&lt;/P&gt;
&lt;P&gt;10091998&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Code I tried:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;dobm=substr(dob,1,2);&lt;BR /&gt;dobd=substr(dob,3,2);&lt;BR /&gt;doby=substr(dob,5,4);&lt;BR /&gt;dobchar=compress(dobm||'/'||dobd||'/'||doby);&lt;BR /&gt;dobnum=input(strip(dobchar),mmddyy10.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;ERROR:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;NOTE: Invalid argument to function INPUT at line 622 column 8.&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2017 18:29:48 GMT</pubDate>
    <dc:creator>GreggB</dc:creator>
    <dc:date>2017-09-22T18:29:48Z</dc:date>
    <item>
      <title>convert a string to a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-a-string-to-a-date-value/m-p/398197#M96282</link>
      <description>&lt;P&gt;&lt;U&gt;sample data for dob:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;12201999&lt;/P&gt;
&lt;P&gt;01142000&lt;/P&gt;
&lt;P&gt;10091998&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Code I tried:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;dobm=substr(dob,1,2);&lt;BR /&gt;dobd=substr(dob,3,2);&lt;BR /&gt;doby=substr(dob,5,4);&lt;BR /&gt;dobchar=compress(dobm||'/'||dobd||'/'||doby);&lt;BR /&gt;dobnum=input(strip(dobchar),mmddyy10.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;ERROR:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;NOTE: Invalid argument to function INPUT at line 622 column 8.&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached. Further errors of this type will not be printed.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 18:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-a-string-to-a-date-value/m-p/398197#M96282</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-09-22T18:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: convert a string to a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-a-string-to-a-date-value/m-p/398210#M96285</link>
      <description>&lt;P&gt;It's not clear whether your original DOB variable is numeric or character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's character:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dobnum = input(dob, mmddyy8.);&lt;/P&gt;
&lt;P&gt;format dobnum yymmdd10.; &amp;nbsp; &amp;nbsp;/* or whatever format you prefer */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's numeric:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dobunum&amp;nbsp;= input( put(dob,z8.), mmddyy8.);&lt;/P&gt;
&lt;P&gt;format dobnum yymmdd10.; &amp;nbsp; /* or whatever format you prefer */&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 19:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-a-string-to-a-date-value/m-p/398210#M96285</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-22T19:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: convert a string to a date value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/convert-a-string-to-a-date-value/m-p/398213#M96288</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;, dob is a &lt;U&gt;string&lt;/U&gt; according to the &lt;U&gt;subject&lt;/U&gt; and to the use&amp;nbsp;of &lt;U&gt;substr&lt;/U&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 19:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/convert-a-string-to-a-date-value/m-p/398213#M96288</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-09-22T19:18:51Z</dc:date>
    </item>
  </channel>
</rss>

