<?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: XML not importing due to date issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XML-not-importing-due-to-date-issue/m-p/503653#M134629</link>
    <description>&lt;P&gt;Well, not really going to be possible to work this out, would need to see the map and the xml part.&amp;nbsp; If that warning is the one you get, then it appears to be truncating the text, so I would check the xmlmap and see if there is any length constraint or format/informat applied there which may be affecting the read.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Oct 2018 08:51:37 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-10-12T08:51:37Z</dc:date>
    <item>
      <title>XML not importing due to date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-not-importing-due-to-date-issue/m-p/503631#M134622</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to import XML file which has a date 02/29/1956. While importing the XML file I am encountering the following error -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Data contains invalid content for date datatype. Invalid content is 02/29/19.&lt;BR /&gt;occurred at or near line 3006, column 251&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have even used the YEARCUTOFF option but still facing the same error. Please help me in getting the issue resolved.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename xx temp;
libname xx xmlv2  '&amp;lt;folder&amp;gt;/Sample1.XML' automap=replace xmlmap=xx;

data entity;
set xx.entity;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Oct 2018 06:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-not-importing-due-to-date-issue/m-p/503631#M134622</guid>
      <dc:creator>Anindya</dc:creator>
      <dc:date>2018-10-12T06:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: XML not importing due to date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-not-importing-due-to-date-issue/m-p/503653#M134629</link>
      <description>&lt;P&gt;Well, not really going to be possible to work this out, would need to see the map and the xml part.&amp;nbsp; If that warning is the one you get, then it appears to be truncating the text, so I would check the xmlmap and see if there is any length constraint or format/informat applied there which may be affecting the read.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 08:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-not-importing-due-to-date-issue/m-p/503653#M134629</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-12T08:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: XML not importing due to date issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-not-importing-due-to-date-issue/m-p/503747#M134661</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76930"&gt;@Anindya&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to import XML file which has a date &lt;FONT size="4"&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff"&gt;02/29/1956&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;. While importing the XML file I am encountering the following error -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: Data contains invalid content for date datatype. Invalid content is &lt;FONT size="4"&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;02/29/19&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;BR /&gt;occurred at or near line 3006, column 251&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have even used the YEARCUTOFF option but still facing the same error. Please help me in getting the issue resolved.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename xx temp;
libname xx xmlv2  '&amp;lt;folder&amp;gt;/Sample1.XML' automap=replace xmlmap=xx;

data entity;
set xx.entity;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Compare the text in your question I highlighted in blue and in the error message in red. See a difference?&lt;/P&gt;
&lt;P&gt;The error message would indicate that something is truncating the value to 6 characters. So the year is being read using only two digits, 19. The yearcutoff only effects how the last two years of a date would be treated. Since the 56 is apparently not there then you would be reading that year as either 1919 or 2019, neither of which can be a leap year (Feb 29 only occurring in such).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So either the value in the XML is not what you believe or perhaps the xmlmap was built incorrectly and is only using 8 instead of 10 characters. I would verify if other dates are correct as it is likely that you have a lot of dates from either 2019 or 1919 if the map is incorrect.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 14:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-not-importing-due-to-date-issue/m-p/503747#M134661</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-12T14:59:44Z</dc:date>
    </item>
  </channel>
</rss>

