<?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 Map: Hiding elementgs when value is missing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505697#M135458</link>
    <description>&lt;P&gt;The output is the code block on top with the section highlighted in red. The vendor that I send the xml to requires that if the value is empty then the element should be hidden. There's a few other pieces of the map that would require this as well so understanding how to do it is extremely important.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Oct 2018 18:53:12 GMT</pubDate>
    <dc:creator>micahmouw</dc:creator>
    <dc:date>2018-10-18T18:53:12Z</dc:date>
    <item>
      <title>XML Map: Hiding elementgs when value is missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505253#M135285</link>
      <description>&lt;P&gt;I'm having trouble figuring out how to hide an entire element on an xml output when there is no value. Here's an example;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;address_1&amp;gt;JOHN SMITH&amp;lt;/address_1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;address_3&amp;gt;555 SMITH STREET&amp;lt;/address_3&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&amp;lt;address_4&amp;gt; &amp;lt;/address_4&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I would like to address_4 to be hidden when there is no value. Here is what it looks like in my map;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;COLUMN name="sbad_addr2_mail"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PATH syntax="XPath"&amp;gt;/stmt/stmt_detail/generic_letter_1/send_address/address_4&amp;lt;/PATH&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TYPE&amp;gt;character&amp;lt;/TYPE&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DATATYPE&amp;gt;string&amp;lt;/DATATYPE&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/COLUMN&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;Any help would be much appreciated. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;Thanks,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;Micah&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 18:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505253#M135285</guid>
      <dc:creator>micahmouw</dc:creator>
      <dc:date>2018-10-17T18:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: XML Map: Hiding elementgs when value is missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505380#M135336</link>
      <description>&lt;P&gt;Why would you do this?&lt;/P&gt;
&lt;P&gt;If you delete the part in red then the map does not match the output.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 22:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505380#M135336</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-17T22:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: XML Map: Hiding elementgs when value is missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505697#M135458</link>
      <description>&lt;P&gt;The output is the code block on top with the section highlighted in red. The vendor that I send the xml to requires that if the value is empty then the element should be hidden. There's a few other pieces of the map that would require this as well so understanding how to do it is extremely important.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 18:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505697#M135458</guid>
      <dc:creator>micahmouw</dc:creator>
      <dc:date>2018-10-18T18:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: XML Map: Hiding elementgs when value is missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505834#M135510</link>
      <description>&lt;P&gt;I&amp;nbsp;might be mistaken, but&amp;nbsp;I am pretty sure that the structure must match the map.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The incomplete XML can still be read of course, but deleting (not hiding, deleting right?) entries because they have a certain value like space is bizarre.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS will not do this as far as I know. You'll have to do it post-export:&lt;/P&gt;
&lt;P&gt;1- Generate the XML file&lt;/P&gt;
&lt;P&gt;2- Read the text file in a data step and alter it however you like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 04:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/505834#M135510</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-19T04:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: XML Map: Hiding elementgs when value is missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/506085#M135594</link>
      <description>&lt;P&gt;Actually I'm just looking to hide the element. I'll try and explain it a little bit better. basically the data table will have, lets say, 100 records. I'll run the program to export it to SAS. 50 of the 100 records do not contain&amp;nbsp;data for&amp;nbsp;address_4. For those records that do not contain data for address_4 I would like to have the entire field hidden. Here's an example;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;No value for address_4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;send_address&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;address_1&amp;gt;JOHN SMITH&amp;lt;/address_1&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;address_3&amp;gt;555 SMITH&amp;nbsp;WAY&amp;lt;/address_3&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;city&amp;gt;SMITH&amp;lt;/city&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;state&amp;gt;CA&amp;lt;/state&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;zip&amp;gt;8675309&amp;lt;/zip&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/send_address&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG&gt;Value present for address_4&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;send_address&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;address_1&amp;gt;JOHNETTE SMITH&amp;lt;/address_1&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;address_3&amp;gt;555 JOHNETTE&amp;nbsp;ST&amp;lt;/address_3&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&amp;lt;address_4&amp;gt;APARTMENT A&amp;lt;/address_4&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;city&amp;gt;SMITH&amp;lt;/city&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;state&amp;gt;CA&amp;lt;/state&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;zip&amp;gt;8675309&amp;lt;/zip&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/send_address&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this makes sense. I would think it would be possible at least I really hope it is. Thanks for the feedback so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Micah&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/506085#M135594</guid>
      <dc:creator>micahmouw</dc:creator>
      <dc:date>2018-10-19T17:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: XML Map: Hiding elementgs when value is missing        &lt;address_4&gt; &lt;/address_4&gt;</title>
      <link>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/506276#M135692</link>
      <description>&lt;P&gt;An XML file is a flat text file. You can't hide anything. Either something is there and it's visible, or it's not there. There's no hiding.&lt;/P&gt;
&lt;P&gt;So you apparently want to delete some lines in the text file.&lt;/P&gt;
&lt;P&gt;To do that, read it in a data step after it's created, and remove all lines that have an unwanted value.&lt;/P&gt;
&lt;P&gt;The step might look similar to this:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data _null_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; infile XMLIN;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; file XMLOUT;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; input;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; if _infile_ ne '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;address_4&amp;gt; &amp;lt;/address_4&amp;gt;';&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; put _infile_; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 23:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/XML-Map-Hiding-elementgs-when-value-is-missing/m-p/506276#M135692</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-10-20T23:52:40Z</dc:date>
    </item>
  </channel>
</rss>

