<?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 dates that are not complete and contain irrelevant letters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-dates-that-are-not-complete-and-contain-irrelevant/m-p/278386#M56002</link>
    <description>Hi:&lt;BR /&gt;  What is the 'un'? Is it a code that stands for "unknown" or is it the word for a number un=uno?&lt;BR /&gt;&lt;BR /&gt;  In either case, assuming that date is a character variable and that you need to substitute a day value for the 'un' for the INPUT to work correctly, you have to pick a day value to substitute for the 'un' - I generally choose 01, but you could choose 15 or 30 or any other number.&lt;BR /&gt;&lt;BR /&gt;  I would suggest a simple IF statement (not tested):&lt;BR /&gt;  if index(date,'un') &amp;gt; 0 then do;&lt;BR /&gt;    date1 = input(catt('01'||substr(date,3)),date11.);&lt;BR /&gt;  end;&lt;BR /&gt;  else date1=input(date,date11.);&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
    <pubDate>Sat, 18 Jun 2016 14:46:52 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2016-06-18T14:46:52Z</dc:date>
    <item>
      <title>Reading dates that are not complete and contain irrelevant letters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-dates-that-are-not-complete-and-contain-irrelevant/m-p/278325#M55989</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my data, the date variable has values&amp;nbsp;16/Oct/2015 and&amp;nbsp;un/Jan/2016.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the code to convert to IS8601 dates.&lt;/P&gt;&lt;P&gt;code:&lt;/P&gt;&lt;P&gt;date1=input(date,date11.);&lt;BR /&gt;isdate=put(date1,is8601da.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code is not converting the "&lt;SPAN&gt;un/Jan/2016&lt;/SPAN&gt;". What should I include in my code. I need value '2016-01' for '&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;un/Jan/2016&lt;/SPAN&gt;&lt;SPAN&gt;".&lt;/SPAN&gt;' &amp;nbsp;Please help. Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 22:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-dates-that-are-not-complete-and-contain-irrelevant/m-p/278325#M55989</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-06-17T22:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading dates that are not complete and contain irrelevant letters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-dates-that-are-not-complete-and-contain-irrelevant/m-p/278386#M56002</link>
      <description>Hi:&lt;BR /&gt;  What is the 'un'? Is it a code that stands for "unknown" or is it the word for a number un=uno?&lt;BR /&gt;&lt;BR /&gt;  In either case, assuming that date is a character variable and that you need to substitute a day value for the 'un' for the INPUT to work correctly, you have to pick a day value to substitute for the 'un' - I generally choose 01, but you could choose 15 or 30 or any other number.&lt;BR /&gt;&lt;BR /&gt;  I would suggest a simple IF statement (not tested):&lt;BR /&gt;  if index(date,'un') &amp;gt; 0 then do;&lt;BR /&gt;    date1 = input(catt('01'||substr(date,3)),date11.);&lt;BR /&gt;  end;&lt;BR /&gt;  else date1=input(date,date11.);&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Sat, 18 Jun 2016 14:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-dates-that-are-not-complete-and-contain-irrelevant/m-p/278386#M56002</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-06-18T14:46:52Z</dc:date>
    </item>
  </channel>
</rss>

