<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: importing xml file with var name length longer than 32 characters in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913452#M44213</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure I understand. Suppose that the xlm file has always the same schema, how do we write a map file&lt;/P&gt;
&lt;P&gt;Please provide an example.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jan 2024 18:08:01 GMT</pubDate>
    <dc:creator>alepage</dc:creator>
    <dc:date>2024-01-29T18:08:01Z</dc:date>
    <item>
      <title>importing xml file with var name length longer than 32 characters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913435#M44211</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using a proc http procedure to download an xml file on a unix server and that part goes well.&lt;/P&gt;
&lt;P&gt;The issue is when I am trying to import this xml file into a SAS data set, it failed because some variables length are longer than 32 characters.&amp;nbsp; How to solve that issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title1 'Reading the XML File Survey Response';
libname in xml "/.../LEGO_3064_Broker_Virage/Surveys/Virage_Survey.xml";
data SurveyResponse;
 set in.Virage_Survey ;
run;
title2 'check parsing of file';
proc print data=SurveyResponse;
run;
proc contents data=SurveyResponse;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;NOTE: Libref IN was successfully assigned as follows: 
      Engine:        XML 
      Physical Name: /...LEGO_3064_Broker_Virage/Surveys/Virage_Survey.xml
31         data SurveyResponse;
32          set in.Virage_Survey ;
ERROR: The XML element name &amp;lt;QID2_TEXT_8cb70e63_1kek94049fwnActionability&amp;gt; is too long for a SAS variable name.

ERROR: Encountered during XMLMap parsing at or near line 77, column 49.
ERROR: XML describe error: Internal processing error.
33         run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jan 2024 16:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913435#M44211</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-01-29T16:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: importing xml file with var name length longer than 32 characters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913448#M44212</link>
      <description>&lt;P&gt;Is the XML file always using the same schema?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so then write your own MAP file to tell the XML engine how to translate the XML into SAS datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 17:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913448#M44212</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-29T17:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: importing xml file with var name length longer than 32 characters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913452#M44213</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure I understand. Suppose that the xlm file has always the same schema, how do we write a map file&lt;/P&gt;
&lt;P&gt;Please provide an example.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 18:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913452#M44213</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-01-29T18:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: importing xml file with var name length longer than 32 characters</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913453#M44214</link>
      <description>&lt;P&gt;First just try using XMLV2 engine instead of the older XML engine.&amp;nbsp; Perhaps it is smarter about dealing with long field names in the XML.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that doesn't fix the issue then Read the documentation.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/engxml/n1p6kbmn43fz0en1tajxf3y7karg.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/engxml/n1p6kbmn43fz0en1tajxf3y7karg.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is even a tool that SAS had for crafting XMLMAP files.&amp;nbsp; Never worked that well for me.&amp;nbsp; I found it was just easier to take the autogenerated map and clean it up manually.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 18:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-xml-file-with-var-name-length-longer-than-32/m-p/913453#M44214</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-29T18:13:06Z</dc:date>
    </item>
  </channel>
</rss>

