Hi:
When I create an XML file from a SAS dataset, like this:
[pre]
** make a SAS dataset with both date and datetime variables;
data bday;
infile datalines;
input name $ bdate : ddmmyy10. dtvar : datetime18.;
format bdate ddmmyy10.;
return;
datalines;
anne 15/11/1950 15nov1950:07:15:00
bob 23/08/1951 23aug1951:10:23:00
;
run;
** Create XML file FROM SAS data;
libname out xml 'C:\temp\outSAS.xml';
data out.bday;
set bday;
run;
libname out clear;
[/pre]
This is the XML output file that I get:
[pre]
<?xml version="1.0" encoding="windows-1252" ?>
<TABLE>
<BDAY>
<name> anne </name>
<bdate> 1950-11-15 </bdate>
<dtvar> -288031500 </dtvar>
</BDAY>
<BDAY>
<name> bob </name>
<bdate> 1951-08-23 </bdate>
<dtvar> -263741820 </dtvar>
</BDAY>
</TABLE>
[/pre]
When I use this code to READ the XML file back into a SAS dataset (without making any changes to the code):
[pre]
**Reading XML data back into SAS;
libname in xml 'C:\temp\outSAS.xml';
data work.bday_fromxml;
set in.bday;
run;
proc print data=work.bday_fromxml;
format bdate ddmmyy10. dtvar datetime18.;
run;
libname in clear;
[/pre]
This is my resulting PROC PRINT output (neither of my variables for date or datetime are missing):
[pre]
Obs DTVAR BDATE NAME
1 15NOV50:07:15:00 15/11/1950 anne
2 23AUG51:10:23:00 23/08/1951 bob
[/pre]
I ran the code in SAS 9.2...if you are having issues using the SAS XML Libname Engine, you might want to refer to the documentation. I believe that in SAS 8.2, you did need to have dates in ISO format, but that is no longer the case. I'm not sure when the date handling changed. You might with to work with Tech Support on this question. To open a track with Tech Support, go to:
http://support.sas.com/ctx/supportform/createForm
cynthia