<?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: How do I modify an existing XML file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468556#M119695</link>
    <description>&lt;P&gt;Here is a working example. The map of your output "table", i.e. XML file, must be similar to the one below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data _null_;
  file "%sysfunc(pathname(WORK))\output.map" lrecl=32000;
  put'
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;

&amp;lt;SXLEMAP version="1.9"&amp;gt;   

  &amp;lt;OUTPUT&amp;gt;     
    &amp;lt;HEADING&amp;gt;       
      &amp;lt;ATTRIBUTE name="description" value="xml output"/&amp;gt;     
    &amp;lt;/HEADING&amp;gt;     
    &amp;lt;TABLEREF name="OUTTABLE"/&amp;gt;   
  &amp;lt;/OUTPUT&amp;gt; 
 
  &amp;lt;TABLE name="OUTTABLE"&amp;gt;     
    &amp;lt;TABLE-PATH syntax="XPath"&amp;gt;/xml/lev1/lev2/OUTTABLE&amp;lt;/TABLE-PATH&amp;gt;     
    &amp;lt;COLUMN name="DESCRIPTION"&amp;gt;       
      &amp;lt;PATH syntax="XPath"&amp;gt;/xml/lev1/lev2/OUTTABLE/DESCRIPTION&amp;lt;/PATH&amp;gt;       
      &amp;lt;TYPE&amp;gt;character&amp;lt;/TYPE&amp;gt;       
      &amp;lt;DATATYPE&amp;gt;string&amp;lt;/DATATYPE&amp;gt;       
      &amp;lt;LENGTH&amp;gt;50&amp;lt;/LENGTH&amp;gt;     
    &amp;lt;/COLUMN&amp;gt;     
    &amp;lt;COLUMN name="COUNT"&amp;gt;       
      &amp;lt;PATH syntax="XPath"&amp;gt;/xml/lev1/lev2/OUTTABLE/COUNT&amp;lt;/PATH&amp;gt;       
      &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;            
      &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;       
    &amp;lt;/COLUMN&amp;gt;     
    &amp;lt;COLUMN name="PERCENT"&amp;gt;       
      &amp;lt;PATH syntax="XPath"&amp;gt;/xml/lev1/lev2/OUTTABLE/PERCENT&amp;lt;/PATH&amp;gt;       
      &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;       
      &amp;lt;DATATYPE&amp;gt;double&amp;lt;/DATATYPE&amp;gt;       
    &amp;lt;/COLUMN&amp;gt;   
  &amp;lt;/TABLE&amp;gt;

&amp;lt;/SXLEMAP&amp;gt; ';
;run ;

    
filename OUT    "%sysfunc(pathname(WORK))\output.xml";
filename OUTMAP "%sysfunc(pathname(WORK))\output.map";
libname  OUT xml92 xmlmap=OUTMAP;

data OUT.OUTTABLE;              
  length DESCRIPTION $100;
  retain  DESCRIPTION 'abc' COUNT 22 PERCENT 2.2;
run;


%* Dump contents of output file;
data _null_; infile OUT; input; put _infile_ ; run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="windows-1252" ?&amp;gt;
&amp;lt;!--
      SAS XML Libname Engine (SAS92XML)
      SAS XMLMap Generated Output
      Version 9.04.01M2P07232014
      Created 2018-06-08T12:19:09
  --&amp;gt;

&amp;lt;xml description="xml output"&amp;gt;
&amp;lt;lev1&amp;gt;
&amp;lt;lev2&amp;gt;
&amp;lt;OUTTABLE&amp;gt;
&amp;lt;DESCRIPTION&amp;gt;abc&amp;lt;/DESCRIPTION&amp;gt;
&amp;lt;COUNT&amp;gt;22&amp;lt;/COUNT&amp;gt;
&amp;lt;PERCENT&amp;gt;2.2&amp;lt;/PERCENT&amp;gt;
&amp;lt;/OUTTABLE&amp;gt;
&amp;lt;/lev2&amp;gt;
&amp;lt;/lev1&amp;gt;
&amp;lt;/xml&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 00:20:51 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-06-08T00:20:51Z</dc:date>
    <item>
      <title>How do I modify an existing XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468140#M119545</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;a&amp;nbsp;XML file as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="Windows-1252"?&amp;gt;&lt;BR /&gt;&amp;lt;new_examples&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;element_first&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;type&amp;gt;123&amp;lt;/type&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;state&amp;gt;1&amp;lt;/state&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/element_first&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;examples_list&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;example_element&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;name&amp;gt;a&amp;lt;/name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;status&amp;gt;1&amp;lt;/status&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/example_element&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;example_element&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;name&amp;gt;b&amp;lt;/name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;status&amp;gt;3&amp;lt;/status&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/example_element&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/examples_list&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/new_examples&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I have a table Table1 like:&lt;/P&gt;&lt;P&gt;Name Amount&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I want to add the amount to the XML so I end up with:&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="Windows-1252"?&amp;gt;&lt;BR /&gt;&amp;lt;new_examples&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;element_first&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;type&amp;gt;123&amp;lt;/type&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;state&amp;gt;1&amp;lt;/state&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/element_first&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;examples_list&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;example_element&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;name&amp;gt;a&amp;lt;/name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;status&amp;gt;1&amp;lt;/status&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;amount&amp;gt;3&amp;lt;/amount&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/example_element&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;example_element&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;name&amp;gt;b&amp;lt;/name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;status&amp;gt;3&amp;lt;/status&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;amount&amp;gt;12&amp;lt;/amount&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/example_element&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/examples_list&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/new_examples&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read the XML as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename xx temp;
libname xx xmlv2 '\\path\test_xml' automap=replace xmlmap=xx;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It lets me access the information of the XML in SAS, having the table example_element with the two example_element in the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then I don't know how I can modify the&amp;nbsp;XML as if I try to overwrite the table xx.example_element but it does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying first to do a dummy example adding a fixed amount = 10 in all the example_element like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xx.example_element;&lt;BR /&gt;set xx.example_element;
amount = 10;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: Output column amount does not occur in XMLMap definition of table &lt;SPAN&gt;example_element&lt;/SPAN&gt;.&lt;BR /&gt;ERROR: XMLMap for output table &lt;SPAN&gt;example_element&lt;/SPAN&gt; requested but that table did not exist in the XMLMap output section.&lt;BR /&gt;ERROR: Invalid sequence of commands for file XX.&lt;SPAN&gt;example_element&lt;/SPAN&gt;.DATA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS Enterprise Guide 7.1&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 17:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468140#M119545</guid>
      <dc:creator>jotabe</dc:creator>
      <dc:date>2018-06-06T17:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify an existing XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468239#M119570</link>
      <description>&lt;P&gt;In your example, you let SAS define the XML map from the existing file.&lt;/P&gt;
&lt;P&gt;Since the existing file does not have an AMOUNT value, the map doesn't either, and therefore you can't insert values into a column that doesn't exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best option is to modify the map. If you run&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;data tt; infile XX; input; put _infile_; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;you see that SAS created this map:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;!-- ############################################################ --&amp;gt;
&amp;lt;!-- 2018-06-07T15:13:13 --&amp;gt;
&amp;lt;!-- SAS XML Libname Engine Map --&amp;gt;
&amp;lt;!-- Generated by XML Mapper, 904000.0.0.20130522190000_v940 --&amp;gt;
&amp;lt;!-- ############################################################ --&amp;gt;
&amp;lt;!-- ###  Validation report                                   ### --&amp;gt;
&amp;lt;!-- ############################################################ --&amp;gt;

&amp;lt;!-- XMLMap validation completed successfully. --&amp;gt;
&amp;lt;!-- ############################################################ --&amp;gt;
&amp;lt;SXLEMAP name="AUTO_GEN" version="2.1"&amp;gt;
    &amp;lt;NAMESPACES count="0"/&amp;gt;
    &amp;lt;!-- ############################################################ --&amp;gt;
    &amp;lt;TABLE description="new_examples" name="new_examples"&amp;gt;
        &amp;lt;TABLE-PATH syntax="XPath"&amp;gt;/new_examples&amp;lt;/TABLE-PATH&amp;gt;
        &amp;lt;COLUMN class="ORDINAL" name="new_examples_ORDINAL"&amp;gt;
            &amp;lt;INCREMENT-PATH beginend="BEGIN" syntax="XPath"&amp;gt;/new_examples&amp;lt;/INCREMENT-PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
    &amp;lt;/TABLE&amp;gt;
    &amp;lt;!-- ############################################################ --&amp;gt;
    &amp;lt;TABLE description="element_first" name="element_first"&amp;gt;
        &amp;lt;TABLE-PATH syntax="XPath"&amp;gt;/new_examples/element_first&amp;lt;/TABLE-PATH&amp;gt;
        &amp;lt;COLUMN class="ORDINAL" name="new_examples_ORDINAL"&amp;gt;
            &amp;lt;INCREMENT-PATH beginend="BEGIN" syntax="XPath"&amp;gt;/new_examples&amp;lt;/INCREMENT-PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
        &amp;lt;COLUMN class="ORDINAL" name="element_first_ORDINAL"&amp;gt;
            &amp;lt;INCREMENT-PATH beginend="BEGIN" syntax="XPath"&amp;gt;/new_examples/element_first&amp;lt;/INCREMENT-PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
        &amp;lt;COLUMN name="type"&amp;gt;
            &amp;lt;PATH syntax="XPath"&amp;gt;/new_examples/element_first/type&amp;lt;/PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
        &amp;lt;COLUMN name="state"&amp;gt;
            &amp;lt;PATH syntax="XPath"&amp;gt;/new_examples/element_first/state&amp;lt;/PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
    &amp;lt;/TABLE&amp;gt;
    &amp;lt;!-- ############################################################ --&amp;gt;
    &amp;lt;TABLE description="examples_list" name="examples_list"&amp;gt;
        &amp;lt;TABLE-PATH syntax="XPath"&amp;gt;/new_examples/examples_list&amp;lt;/TABLE-PATH&amp;gt;
        &amp;lt;COLUMN class="ORDINAL" name="new_examples_ORDINAL"&amp;gt;
            &amp;lt;INCREMENT-PATH beginend="BEGIN" syntax="XPath"&amp;gt;/new_examples&amp;lt;/INCREMENT-PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
        &amp;lt;COLUMN class="ORDINAL" name="examples_list_ORDINAL"&amp;gt;
            &amp;lt;INCREMENT-PATH beginend="BEGIN" syntax="XPath"&amp;gt;/new_examples/examples_list&amp;lt;/INCREMENT-PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
    &amp;lt;/TABLE&amp;gt;
    &amp;lt;!-- ############################################################ --&amp;gt;
    &amp;lt;TABLE description="example_element" name="example_element"&amp;gt;
        &amp;lt;TABLE-PATH syntax="XPath"&amp;gt;/new_examples/examples_list/example_element&amp;lt;/TABLE-PATH&amp;gt;
        &amp;lt;COLUMN class="ORDINAL" name="examples_list_ORDINAL"&amp;gt;
            &amp;lt;INCREMENT-PATH beginend="BEGIN" syntax="XPath"&amp;gt;/new_examples/examples_list&amp;lt;/INCREMENT-PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
        &amp;lt;COLUMN class="ORDINAL" name="example_element_ORDINAL"&amp;gt;
            &amp;lt;INCREMENT-PATH beginend="BEGIN" syntax="XPath"&amp;gt;/new_examples/examples_list/example_element&amp;lt;/INCREMENT-PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
        &amp;lt;COLUMN name="name"&amp;gt;
            &amp;lt;PATH syntax="XPath"&amp;gt;/new_examples/examples_list/example_element/name&amp;lt;/PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;character&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;string&amp;lt;/DATATYPE&amp;gt;
            &amp;lt;LENGTH&amp;gt;1&amp;lt;/LENGTH&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
        &amp;lt;COLUMN name="status"&amp;gt;
            &amp;lt;PATH syntax="XPath"&amp;gt;/new_examples/examples_list/example_element/status&amp;lt;/PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;
    &amp;lt;/TABLE&amp;gt;
&amp;lt;/SXLEMAP&amp;gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new map and add a new section for the new column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;        &amp;lt;COLUMN name="amount"&amp;gt;
            &amp;lt;PATH syntax="XPath"&amp;gt;/new_examples/examples_list/example_element/amount&amp;lt;/PATH&amp;gt;
            &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;
            &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;
        &amp;lt;/COLUMN&amp;gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;and use that map to write out the new table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 03:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468239#M119570</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-06-07T03:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify an existing XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468279#M119586</link>
      <description>&lt;P&gt;Thanks for your reply ChrisNZ.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this is the first time I work with XML in SAS and I am quite lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do not know how to "&lt;SPAN&gt;Create a new map and add a new section for the new column" neither "use that map to write out the new table", Also not sure how I can once I have that new table, how I end up with a XML as the one in my example?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I would appreciate a code step by step if that's not too much on how to add the amount = 10 for both, it looks like it must be a couple of easy data steps but I don't know what I should do.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to see how to do this in the documentation but I cannot see anything similar to what I need, just how to read in XMLs and how to export easy XMLs (with less complexity than the one I have). So if someone could point me out what I should look for in the documentation. This is the first time I struggle with SAS documentation until the point of opening a question in this forum and netiher I find a similar question in the forum...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 07:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468279#M119586</guid>
      <dc:creator>jotabe</dc:creator>
      <dc:date>2018-06-07T07:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify an existing XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468556#M119695</link>
      <description>&lt;P&gt;Here is a working example. The map of your output "table", i.e. XML file, must be similar to the one below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data _null_;
  file "%sysfunc(pathname(WORK))\output.map" lrecl=32000;
  put'
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;

&amp;lt;SXLEMAP version="1.9"&amp;gt;   

  &amp;lt;OUTPUT&amp;gt;     
    &amp;lt;HEADING&amp;gt;       
      &amp;lt;ATTRIBUTE name="description" value="xml output"/&amp;gt;     
    &amp;lt;/HEADING&amp;gt;     
    &amp;lt;TABLEREF name="OUTTABLE"/&amp;gt;   
  &amp;lt;/OUTPUT&amp;gt; 
 
  &amp;lt;TABLE name="OUTTABLE"&amp;gt;     
    &amp;lt;TABLE-PATH syntax="XPath"&amp;gt;/xml/lev1/lev2/OUTTABLE&amp;lt;/TABLE-PATH&amp;gt;     
    &amp;lt;COLUMN name="DESCRIPTION"&amp;gt;       
      &amp;lt;PATH syntax="XPath"&amp;gt;/xml/lev1/lev2/OUTTABLE/DESCRIPTION&amp;lt;/PATH&amp;gt;       
      &amp;lt;TYPE&amp;gt;character&amp;lt;/TYPE&amp;gt;       
      &amp;lt;DATATYPE&amp;gt;string&amp;lt;/DATATYPE&amp;gt;       
      &amp;lt;LENGTH&amp;gt;50&amp;lt;/LENGTH&amp;gt;     
    &amp;lt;/COLUMN&amp;gt;     
    &amp;lt;COLUMN name="COUNT"&amp;gt;       
      &amp;lt;PATH syntax="XPath"&amp;gt;/xml/lev1/lev2/OUTTABLE/COUNT&amp;lt;/PATH&amp;gt;       
      &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;            
      &amp;lt;DATATYPE&amp;gt;integer&amp;lt;/DATATYPE&amp;gt;       
    &amp;lt;/COLUMN&amp;gt;     
    &amp;lt;COLUMN name="PERCENT"&amp;gt;       
      &amp;lt;PATH syntax="XPath"&amp;gt;/xml/lev1/lev2/OUTTABLE/PERCENT&amp;lt;/PATH&amp;gt;       
      &amp;lt;TYPE&amp;gt;numeric&amp;lt;/TYPE&amp;gt;       
      &amp;lt;DATATYPE&amp;gt;double&amp;lt;/DATATYPE&amp;gt;       
    &amp;lt;/COLUMN&amp;gt;   
  &amp;lt;/TABLE&amp;gt;

&amp;lt;/SXLEMAP&amp;gt; ';
;run ;

    
filename OUT    "%sysfunc(pathname(WORK))\output.xml";
filename OUTMAP "%sysfunc(pathname(WORK))\output.map";
libname  OUT xml92 xmlmap=OUTMAP;

data OUT.OUTTABLE;              
  length DESCRIPTION $100;
  retain  DESCRIPTION 'abc' COUNT 22 PERCENT 2.2;
run;


%* Dump contents of output file;
data _null_; infile OUT; input; put _infile_ ; run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="windows-1252" ?&amp;gt;
&amp;lt;!--
      SAS XML Libname Engine (SAS92XML)
      SAS XMLMap Generated Output
      Version 9.04.01M2P07232014
      Created 2018-06-08T12:19:09
  --&amp;gt;

&amp;lt;xml description="xml output"&amp;gt;
&amp;lt;lev1&amp;gt;
&amp;lt;lev2&amp;gt;
&amp;lt;OUTTABLE&amp;gt;
&amp;lt;DESCRIPTION&amp;gt;abc&amp;lt;/DESCRIPTION&amp;gt;
&amp;lt;COUNT&amp;gt;22&amp;lt;/COUNT&amp;gt;
&amp;lt;PERCENT&amp;gt;2.2&amp;lt;/PERCENT&amp;gt;
&amp;lt;/OUTTABLE&amp;gt;
&amp;lt;/lev2&amp;gt;
&amp;lt;/lev1&amp;gt;
&amp;lt;/xml&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 00:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/468556#M119695</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-06-08T00:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify an existing XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/469327#M120035</link>
      <description>&lt;P&gt;I think you could use the XML Mapper application to modify the map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=engxml&amp;amp;docsetTarget=n0mxvt7afwoqron1pioilw0vzxq1.htm&amp;amp;locale=en" target="_self"&gt;http://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=engxml&amp;amp;docsetTarget=n0mxvt7afwoqron1pioilw0vzxq1.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 17:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/469327#M120035</guid>
      <dc:creator>maggiem_sas</dc:creator>
      <dc:date>2018-06-11T17:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify an existing XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/469418#M120075</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31547"&gt;@maggiem_sas&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sadly most SAS developers these days have to endure SAS EG with nothing else available, because of SAS Institute licencing choices.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wish SAS employees ate the same dog food and only used EG as well. This would without a doubt ensure swift changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 21:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/469418#M120075</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-06-11T21:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify an existing XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/469437#M120085</link>
      <description>&lt;P&gt;The SAS XML Mapper does not require a license.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 22:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/469437#M120085</guid>
      <dc:creator>maggiem_sas</dc:creator>
      <dc:date>2018-06-11T22:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I modify an existing XML file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/469438#M120086</link>
      <description>&lt;P&gt;Regardless, XML mapper never gets deployed with EG. It is probably not even supplied, and can certainly not be installed by downloading it in most corporations.&amp;nbsp;I recall &lt;SPAN&gt;XML mapper&amp;nbsp;&lt;/SPAN&gt;used to get deployed with desktop SAS, together with graph'n'go, licence updater, etc.&lt;/P&gt;
&lt;P&gt;I am only mentioning the licence because that's how SAS Institute killed SAS desktop.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 22:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-modify-an-existing-XML-file/m-p/469438#M120086</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-06-11T22:46:39Z</dc:date>
    </item>
  </channel>
</rss>

