<?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: XML to SAS dataset not concatenating repeating elements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XML-to-SAS-dataset-not-concatenating-repeating-elements/m-p/732315#M228205</link>
    <description>&lt;P&gt;Can you indicate which lines in the referenced link lead to this expectation?&lt;/P&gt;
&lt;P&gt;I expect (based on this &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=engxml&amp;amp;docsetTarget=n0espt0codk85vn1dki2g61pzd2j.htm&amp;amp;locale=en" target="_blank" rel="noopener nofollow noreferrer"&gt;webpage&lt;/A&gt;) the value of column g for the first observation to equal the concatenation value1value2. However, the first observation has value of column g equal to value1, which also happens if I set the table-path/observation boundary equal to any of:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the "values" are numeric then that would be a serious abuse of the data. You can't "concatenate" numerics if the field is supposed to be numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will have to go with the second approach and then write code to concatenate the values after it is in a data set. There are numerous requests and responses on how to do that on this forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Apr 2021 19:25:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-04-08T19:25:22Z</dc:date>
    <item>
      <title>XML to SAS dataset not concatenating repeating elements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-to-SAS-dataset-not-concatenating-repeating-elements/m-p/732283#M228198</link>
      <description>&lt;P&gt;I have an XML file in the following structure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;root&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&amp;lt;c&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-90px"&gt;&amp;lt;d&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-120px"&gt;&amp;lt;e&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-150px"&gt;&amp;lt;f&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-180px"&gt;&amp;lt;g&amp;gt; value1 &amp;lt;/g&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-150px"&gt;&amp;lt;/f&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-150px"&gt;&amp;lt;f&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-180px"&gt;&amp;lt;g&amp;gt; value2 &amp;lt;/g&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-150px"&gt;&amp;lt;/f&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-120px"&gt;&amp;lt;/e&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-90px"&gt;&amp;lt;/d&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&amp;lt;/c&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&amp;lt;c&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-90px"&gt;&amp;lt;d&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-120px"&gt;&amp;lt;e&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-150px"&gt;&amp;lt;f&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-180px"&gt;&amp;lt;g&amp;gt; value3 &amp;lt;/g&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-150px"&gt;&amp;lt;/f&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-150px"&gt;&amp;lt;f&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-180px"&gt;&amp;lt;g&amp;gt; value4 &amp;lt;/g&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-150px"&gt;&amp;lt;/f&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-120px"&gt;&amp;lt;/e&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-90px"&gt;&amp;lt;/d&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&amp;lt;/c&amp;gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/root&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the element "g" is repeating within the following observation boundary/table-path:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;/root/a,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I set the column-path in my XML map equal to:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;/root/a/b/c/d/e/f/g,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I expect (based on this &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=engxml&amp;amp;docsetTarget=n0espt0codk85vn1dki2g61pzd2j.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;webpage&lt;/A&gt;) the value of column g for the first observation to equal the concatenation value1value2. However, the first observation has value of column g equal to value1, which also happens if I set the table-path/observation boundary equal to any of:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/root/a, /root/a/b, ..., /root/a/b/.../e.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I set the observation boundary/table-path in my XML map to:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;/root/a/b/.../e/f&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get value1 and value2 in separate observations/rows, as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how I can get the concatenation I want to work?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 18:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-to-SAS-dataset-not-concatenating-repeating-elements/m-p/732283#M228198</guid>
      <dc:creator>Jasdeep_Kochhar</dc:creator>
      <dc:date>2021-04-08T18:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: XML to SAS dataset not concatenating repeating elements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-to-SAS-dataset-not-concatenating-repeating-elements/m-p/732315#M228205</link>
      <description>&lt;P&gt;Can you indicate which lines in the referenced link lead to this expectation?&lt;/P&gt;
&lt;P&gt;I expect (based on this &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=engxml&amp;amp;docsetTarget=n0espt0codk85vn1dki2g61pzd2j.htm&amp;amp;locale=en" target="_blank" rel="noopener nofollow noreferrer"&gt;webpage&lt;/A&gt;) the value of column g for the first observation to equal the concatenation value1value2. However, the first observation has value of column g equal to value1, which also happens if I set the table-path/observation boundary equal to any of:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the "values" are numeric then that would be a serious abuse of the data. You can't "concatenate" numerics if the field is supposed to be numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will have to go with the second approach and then write code to concatenate the values after it is in a data set. There are numerous requests and responses on how to do that on this forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 19:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-to-SAS-dataset-not-concatenating-repeating-elements/m-p/732315#M228205</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-08T19:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: XML to SAS dataset not concatenating repeating elements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-to-SAS-dataset-not-concatenating-repeating-elements/m-p/732325#M228206</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. The third paragraph states:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;If you do not identify the appropriate observation boundary, the result could be a concatenated data string instead of separate observations."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although I realise now that this says it the result could be a concatenated data string, but it does not say that this will definitely happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In regards to using the second approach, I'm okay to do this using retained variables after the data has been set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 19:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-to-SAS-dataset-not-concatenating-repeating-elements/m-p/732325#M228206</guid>
      <dc:creator>Jasdeep_Kochhar</dc:creator>
      <dc:date>2021-04-08T19:37:41Z</dc:date>
    </item>
  </channel>
</rss>

