XML 9.3 Having problems getting Class=Filename to work. Any suggestions

Reply
New Contributor
Posts: 3

XML 9.3 Having problems getting Class=Filename to work. Any suggestions

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

SAS Employee
Posts: 31

Re: XML 9.3 Having problems getting Class=Filename to work. Any suggestions

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

New Contributor
Posts: 3

Re: XML 9.3 Having problems getting Class=Filename to work. Any suggestions

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

SAS Employee
Posts: 31

Re: XML 9.3 Having problems getting Class=Filename to work. Any suggestions

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.

New Contributor
Posts: 3

Re: XML 9.3 Having problems getting Class=Filename to work. Any suggestions

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

SAS Employee
Posts: 31

Re: XML 9.3 Having problems getting Class=Filename to work. Any suggestions

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

N/A
Posts: 1

Re: XML 9.3 Having problems getting Class=Filename to work. Any suggestions

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

Ask a Question
Discussion stats
  • 6 replies
  • 335 views
  • 0 likes
  • 3 in conversation