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!!! */


;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1109 views
  • 2 likes
  • 2 in conversation