11-11-2014 02:53 PM
I have data in XML format, and normally I have no issues parsing the data into tables using the SAS XML engine. In a recent version of an XML file, I noticed variables "date_time0" and "date_time1" being created in the SAS dataset instead of a "date_time" variable. There are no tags in the XML file corresponding to date_time0 or date_time1, only date_time. The date_time1 variable is blank, and the date_time0 variable contains the values for the date_time tag. Previously when this has occurred, the culprit was duplicated tags - it appeared that the XML engine was adding 0 and 1 as suffixes to the names to make them unique. This is not the case here - I wrote some R code to scan the XML file for duplicated tags (with great success in the past), and none were found.
Interestingly, when I use SAS XMLV2 instead of XML (or use the R XML package), it (correctly) parses the data properly, and just creates date_time (not date_time0 and date_time1). The issue with using XMLV2 is that some of the data contain tags that cause XMLV2 to halt, such as the less-than-or-equal-to or greater-than-or-equal-to symbols.
Apologies for not being able to upload a reproducible example: the data is part of a clinical trial, so I can't share the XML file. If there's any other additional information I can provide, please let me know.
Any help greatly appreciated,
JFB (SAS 9.3 TS Level 1M0 x64_7PRO)