<?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: How to fix the invalid values when reading from XML without XML mapper? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384625#M91864</link>
    <description>&lt;P&gt;This is of the format &lt;STRONG&gt;MM/DD/YYYY&amp;nbsp;&lt;/STRONG&gt;which is obviously invalid as there is no day with value &lt;STRONG&gt;00&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this shows me the error invalid date, which I am trying fix now&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 14:29:41 GMT</pubDate>
    <dc:creator>jjames1</dc:creator>
    <dc:date>2017-08-01T14:29:41Z</dc:date>
    <item>
      <title>How to fix the invalid values when reading from XML without XML mapper?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384619#M91860</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still trying to deal with&amp;nbsp;the issue of fixing the invalid dates when trying to read &lt;A href="https://communities.sas.com/t5/General-SAS-Programming/External-file-contains-invalid-date/m-p/383945#M48709" target="_self"&gt;some XML files&lt;/A&gt;&amp;nbsp;from SAS. I use the following code to read my xml files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename ABC temp;
libname ABC xmlv2 '/folders/myfolders/temp.xml' automap=replace xmlmap=ABC ;

proc copy in=ABC out=work noclone;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I thank all of the solutions suggested by everyone, but I could not make any of them to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still SAS &amp;nbsp;is giving me the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;ERROR: Data contains invalid content for date datatype. Invalid content is 07/00/20.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I have around 20 variables in one single file and &amp;nbsp;I read from multiple files.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I have some solutions that I am thinking of&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;1. Force read the invalid values from SAS when doing the xml mapping&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;2. Remove the /00 from these attributes when reading as in my case I am bothered of only the month and year&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;3. Modify the XML parser inorder to read these dates as it is&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I am not an expert in SAS,&lt;FONT color="#000000"&gt;&amp;nbsp;I would really appreciate for any ideas on how to approach these suggested solution or anything else &amp;nbsp;inorder to fix this issue&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks in Advance!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384619#M91860</guid>
      <dc:creator>jjames1</dc:creator>
      <dc:date>2017-08-01T14:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix the invalid values when reading from XML without XML mapper?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384624#M91863</link>
      <description>&lt;P&gt;What does&amp;nbsp;&lt;STRONG&gt;07/00/20&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually mean? 20Jul2000? &amp;nbsp;Not sure there is a format off the shelf to handle such an occurence - never seen a date represented like this. &amp;nbsp;You may need a picture format setup for it, or read it in as text, then process it:&lt;/P&gt;
&lt;PRE&gt;date=mdy(input(scan(c_date,1,"/"),best.),input(scan(c_date,3,"/"),best.),input(scan(c_date,2,"/"),best.));
&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:23:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384624#M91863</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-01T14:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix the invalid values when reading from XML without XML mapper?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384625#M91864</link>
      <description>&lt;P&gt;This is of the format &lt;STRONG&gt;MM/DD/YYYY&amp;nbsp;&lt;/STRONG&gt;which is obviously invalid as there is no day with value &lt;STRONG&gt;00&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this shows me the error invalid date, which I am trying fix now&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384625#M91864</guid>
      <dc:creator>jjames1</dc:creator>
      <dc:date>2017-08-01T14:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix the invalid values when reading from XML without XML mapper?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384628#M91865</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151007"&gt;@jjames1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This is of the format &lt;STRONG&gt;MM/DD/YYYY&amp;nbsp;&lt;/STRONG&gt;which is obviously invalid as there is no day with value &lt;STRONG&gt;00&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So this shows me the error invalid date, which I am trying fix now&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can't "fix" this as such. &amp;nbsp;SAS's variables are strongly typed, so you cannot put an invalid date into a date variable. &amp;nbsp;Therefore you need to read that in as text.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:39:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384628#M91865</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-01T14:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix the invalid values when reading from XML without XML mapper?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384630#M91866</link>
      <description>&lt;P&gt;But how can I read it as a text when all the mapping is done automatically?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384630#M91866</guid>
      <dc:creator>jjames1</dc:creator>
      <dc:date>2017-08-01T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix the invalid values when reading from XML without XML mapper?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384641#M91869</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151007"&gt;@jjames1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;But how can I read it as a text when all the mapping is done automatically?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I believe the previous time you asked this question the suggestion was to save the map file, edit it for the problem variables to create text variables and then parse the resulting text. Did you try that approach?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or is this an endemic problem where you are getting many different structured xml files with the same data problem? In which case it may well be worth working up the chain of the data to find out what is putting invalid dates into a "date" field. It will help if you have worked through one example of correcting the xml map , importing the data and correcting the issue. Record the time involved to point out to managment the costs involved in fixing something that&amp;nbsp;IMHO is a "shoot yourself in the foot" type of error.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 15:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-fix-the-invalid-values-when-reading-from-XML-without-XML/m-p/384641#M91869</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-01T15:11:17Z</dc:date>
    </item>
  </channel>
</rss>

