xml import problem

Reply
Occasional Contributor
Posts: 8

xml import problem

Hi,

I have a xml file NOT imported correctly:

--------------xml file------------------------------

<?xml

version="1.0"

standalone="yes"

?>

<NewDataSet>

<SasData>

  <week>19932</week>

  <AFL_GA>8.0143357372994242</AFL_GA>

  <af>0</af>

</SasData>

<SasData>

  <week>19939</week>

    <af>0.6</af>

</SasData>

</NewDataSet>

-------------sas code---------------------------------------

libname  myxml xml 'c:\testdata.xml';

-----------------SASDATA--------------

AF1AF0WEEK
.8.01433619932
..19939

---------------------------------------------------------------------

The variable names are change! (AFL_GA -->AF0    AF-->AF1?) Please give me some suggestion to correct this error. Thanks.

Grand Advisor
Posts: 17,332

Re: xml import problem

How did you import the file?

Occasional Contributor
Posts: 8

Re: xml import problem

/*-------------sas code---------------------------------------*/

libname  myxml xml 'c:\testdata.xml';

/*Check the libraries in EG or add the following code:*/

data test;

set myxml.sasdata;

run;

Grand Advisor
Posts: 17,332

Re: xml import problem

Try Bruno's method here:

Occasional Contributor
Posts: 8

Re: xml import problem

Thanks. It works by changing xml to xmlv2:

libname  myxml xmlv2 'c:\testdata.xml';

Ask a Question
Discussion stats
  • 4 replies
  • 303 views
  • 3 likes
  • 2 in conversation