BookmarkSubscribeRSS Feed
ren_s
Fluorite | Level 6

Hi all,

 

first of, I apologize if this question should be asked in another board.

 

I generated a .map file from an XML. I would them read (SELECT) from an xml file to generate tabular data. The XML files contain a deep structure, i.e., they are not tabular.

 

PROBLEM: when reading the xml with the generated map, the key columns are always missing.

 

1) Here is an extract from the .map file (table "acts"):

 

<!-- ############################################################ -->
    <TABLE description="acts" name="acts">
        <TABLE-PATH syntax="XPathENR">/{1}corpcan/blablas/blabla/acts</TABLE-PATH>

        <COLUMN class="ORDINAL" name="blabla_ORDINAL">
            <INCREMENT-PATH beginend="BEGIN" syntax="XPathENR">/{1}corpcan/blablas/blabla</INCREMENT-PATH>
            <TYPE>numeric</TYPE>
            <DATATYPE>integer</DATATYPE>
        </COLUMN>

        <COLUMN class="ORDINAL" name="acts_ORDINAL">
            <INCREMENT-PATH beginend="BEGIN" syntax="XPathENR">/{1}corpcan/blablas/blabla/acts</INCREMENT-PATH>
            <TYPE>numeric</TYPE>
            <DATATYPE>integer</DATATYPE>
        </COLUMN>

    </TABLE>

    <!-- ############################################################ -->

 

 

2) Here is an extract of the script used to read the xml:

 

filename  myfile '<PATH_TO_FILE_XML>\<XML_FILE_001>.xml';
filename  SXLEMAP '<.MAP_FILE GENERATED BY XML MAPPER>';
libname   myfile xmlv2 xmlmap=SXLEMAP access=READONLY;

 

 

 

3) Here is the output of the Acts table after reading from the xml. The xml file contains lots of data and these values should not be missing. There should be no missing value at all.

 

tableActs.PNG

 

 

 

Other détails:

SO: Win 7

Enterprise guide: 7.100.2856

Platform version: 9.4.0.0

XML mapper: 903000.0

Does anyone know what could be wrong that SAS is not generating the auto-increment values?

has anyone faced a similar issue?

 

Thanks in advance!

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

You don't provide enough information for us to look at the cause of your problem.

 

Hierarchical XML file structures are detailed here: http://support.sas.com/documentation/cdl/en/engxml/62845/HTML/default/viewer.htm#a002593019.htm

 

 

ren_s
Fluorite | Level 6

I found what caused the problem in my case: it was an option (validvarname):

 

options /*mautosource noxwait notes 
sasautos=('\\<machine>\<path_to_macro_dir>')
        nodate nosymbolgen nomprint errors=3 compress=yes */

		validvarname=upcase  /* THIS OPTION CAUSES THE ERROR!!! */


;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 963 views
  • 2 likes
  • 2 in conversation