Date: Mon, 22 Mar 2010 05:54:23 -0700
Reply-To: Jose <lozanoje@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jose <lozanoje@GMAIL.COM>
Organization: http://groups.google.com
Subject: Reading XML files
Content-Type: text/plain; charset=ISO-8859-1
Hello:
This is the first time I have to face importing an XML file, and I am
a little lost. I've read some docs, and when I think I've found out
how to do it, I've encountered a problem that I cannot solve.
The original XML file is a rectangular dataset (3 levels), which
basically means it has a "simple table" estructure.
I use the SAS XML Mapper to map the original XML to a SAS table. I've
managed to import several fields with no problem, but then, I've found
some fields/colums in the original XML file with the exact same name:
*** START: EXAMPLE XML CODE ****
<code_main>874 </code_main> <code_secondary>455 </code_secondary>
<code_secondary>342.3 </code_secondary> <code_secondary>456 </
code_secondary> <code_secondary>305.1 </code_secondary>
<code_secondary>456.4</code_secondary> <code_secondary/>
<code_secondary/> <code_secondary/> <code_secondary/> <code_secondary/
> <code_secondary/> <code_secondary/> <code_secondary/>
*** END: EXAMPLE XML CODE ****
So, in the original XML file, there are 13 equally named
"code_secondary" fields.
I've mapped them to columns CS1, CS2, CS3, CS4,... , CS13, but when I
import the data, it only read the LAST <code_secondary> and place it
in all the CS1... CS13 columns.
In the example xml code, SAS reads only the value 456.4 and then fills
CS1=456.4, CS2=456.4, CS3=456.4,...,CS13=456.4.
I fear the program gets confused when pointing the original xml file
for code_secondary, but, Is there any way to walk around with this
problem?
Thanks in advance,
Jose Lozano