BookmarkSubscribeRSS Feed
DIsherwood
Fluorite | Level 6

I have a set of files I need to process with the same XMLMAP. My latest approach is to attempt to capture the Filename as a column. Following code runs but contents of File variable is missing.

    <TABLE description="Application" name="Application">
        <TABLE-PATH syntax="XPath">/ApplicationItems/Application</TABLE-PATH>

        <COLUMN class="FILENAME" retain="YES" name="File">
            <TYPE>character</TYPE>
            <DATATYPE>string</DATATYPE>
            <LENGTH>128</LENGTH>
        </COLUMN>

I wonder how I could have this incorrect.

Dave

6 REPLIES 6
BillM_SAS
SAS Employee

Can you supply a representative sample of the XML file you wish to read with the XMLMap file?

DIsherwood
Fluorite | Level 6

Thanks Bill,

I have an example and it is attached: the password is qwerty99. It looks like sensitive data but it isn't and consists of industry accepted examples.

Dave

BillM_SAS
SAS Employee

I have discovered that this is a known problem with the class="FILENAME" usage in the XML LIBNAME engine. Unfortunately, there currently does not appear to be a work-around for the problem with this functionality.

DIsherwood
Fluorite | Level 6

Thanks Bill - serves me right for reading the documentation:smileyconfused:

My more general problem is that I want to concatenate a bundle of XML documents/ files and parse the as a single file. This seems to work except that there are different Ordinal values maintained for each file. Ultimately, this means I end up with entries in the resulting tables that have duplicate values for the ordinal. Is there a code pattern that would allow me to accomplish the concatenation with the ordinals maintained across them all? [My initial hope was use the filename to distinguish the entries].

Any thoughts / approach would be much appreciated.

Thanks,

Dave

BillM_SAS
SAS Employee

Can you supply example code and XML files so I can be certain I understand the problem?

strmwzrd
Fluorite | Level 6

Bill,

Has this issue been resolved (more importantly is there a workaround)? I just spent hours trying to get class="FILENAME" and class="FILEPATH" to work only to get blanks instead. Like Dave I am reading thousands of XML files as one concatenated file and keeping track of where values come from is imperative and duplicate ordinals don't cut it in my application. My workaround is to loop through all the files individually but ...

Thanks.

     mike

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 752 views
  • 2 likes
  • 3 in conversation