<?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: Working with tagsets to create XML with missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489703#M127929</link>
    <description>&lt;P&gt;hello Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already tried this code and what it does, it erase the missing value element like that:&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;TABLE&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;TEST&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;x&amp;gt;1&amp;lt;/x&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;z&amp;gt;3&amp;lt;/z&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/TEST&amp;gt;&lt;BR /&gt;&amp;lt;/TABLE&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what I would like is:&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;TABLE&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;TEST&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;x&amp;gt;1&amp;lt;/x&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;y&amp;gt;&amp;lt;/y&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;z&amp;gt;3&amp;lt;/z&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/TEST&amp;gt;&lt;BR /&gt;&amp;lt;/TABLE&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moreover, I will be very happy to write my own tagset.&amp;nbsp; If you could refer me a good document on the code use, it will be very appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Aug 2018 17:09:13 GMT</pubDate>
    <dc:creator>alepage</dc:creator>
    <dc:date>2018-08-24T17:09:13Z</dc:date>
    <item>
      <title>Working with tagsets to create XML with missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489649#M127908</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the code I am using...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; class;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"Jane"&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;then&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;name=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;" Jane"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; age = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; trans &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;xml&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#800080"&gt;"\\...\Documents\Test\XML\test.xml"&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;xmltype&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;oracle&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; trans.class noprint;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; class;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;libname&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; trans &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;clear&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;A part of my xml file looks like that:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;lt;?xml version="1.0" encoding="windows-1252" ?&amp;gt;&lt;BR /&gt;&amp;lt;ROWSET&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;lt;ROW&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name&amp;gt; Jane&amp;lt;/Name&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Sex&amp;gt;F&amp;lt;/Sex&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Age missing="." /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Height&amp;gt;59.8&amp;lt;/Height&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Weight&amp;gt;84.5&amp;lt;/Weight&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/ROW&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;What I would like to get for missing value is:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;lt;ROW&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name&amp;gt; Jane&amp;lt;/Name&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Sex&amp;gt;F&amp;lt;/Sex&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Age&amp;gt;&amp;lt;/Age&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Height&amp;gt;59.8&amp;lt;/Height&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Weight&amp;gt;84.5&amp;lt;/Weight&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/ROW&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I have look through the information on the web and I know that the use of tagset=tagset.sasxmiss could do the job.&amp;nbsp; Does some one know another tagset who will do the task.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;This procedure below give me the tagset available on my system:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;template&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;list&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tagsets;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&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;&lt;FONT face="Courier New" size="3"&gt;Obviously, the tagset.sasxmiss is not present.&amp;nbsp; Is it possible to download this sasxmiss tagset or to update my tagsets?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Where and how can I update my tagsets for SAS Enterprise Guide 7.11&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 15:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489649#M127908</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2018-08-24T15:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Working with tagsets to create XML with missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489661#M127911</link>
      <description>&lt;P&gt;Are you looking for the &lt;A href="http://support.sas.com/kb/23/621.html" target="_self"&gt;approach in this example&lt;/A&gt;&amp;nbsp;(&lt;EM&gt;Usage Note 23621: With the XML engine, how can I only output a node if it's not missing?&lt;/EM&gt;)?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 16:00:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489661#M127911</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-08-24T16:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Working with tagsets to create XML with missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489703#M127929</link>
      <description>&lt;P&gt;hello Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already tried this code and what it does, it erase the missing value element like that:&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;TABLE&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;TEST&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;x&amp;gt;1&amp;lt;/x&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;z&amp;gt;3&amp;lt;/z&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/TEST&amp;gt;&lt;BR /&gt;&amp;lt;/TABLE&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And what I would like is:&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;TABLE&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;TEST&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;x&amp;gt;1&amp;lt;/x&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;y&amp;gt;&amp;lt;/y&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;z&amp;gt;3&amp;lt;/z&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/TEST&amp;gt;&lt;BR /&gt;&amp;lt;/TABLE&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moreover, I will be very happy to write my own tagset.&amp;nbsp; If you could refer me a good document on the code use, it will be very appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 17:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489703#M127929</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2018-08-24T17:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Working with tagsets to create XML with missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489714#M127935</link>
      <description>&lt;P&gt;Writing tagsets is a bit of an art, and I'm not that great at it.&amp;nbsp; But how about:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   proc template;
      define tagset tagsets.sasxnmis;
         parent = tagsets.sasxmog;
         notes "SAS-XML generic XML-Data - creates empty tag for MISSING";
      define event SASColumn;
      start:
         ndent;
         put     '&amp;lt;' ;
         put     NAME;
         put '&amp;gt;'      / if exists(missing);
         break;
      finish:
         put '&amp;lt;/'       ;
         put NAME       ;
         put '&amp;gt;'  CR    ;
         xdent;
         break;
      end;
      define event MLEVDAT;
         break          / if exists(MISSING);
         put ' value="' / if cmp(XMLDATAFORM, "ATTRIBUTE");
         put VALUE      / if cmp(XMLDATAFORM, "ATTRIBUTE");
         put '"'        / if cmp(XMLDATAFORM, "ATTRIBUTE");
         break          / if cmp(XMLDATAFORM, "ATTRIBUTE");
         put '&amp;gt;'        ;
         put VALUE      ;
         break;
      end;
      end; /* sasxmiss */
   run;

   /*run this once (it will write to sasuser) and then to specify it */
   /*on the libname                                                  */

   libname foo xml 'c:\temp\nomiss.xml' tagset=tagsets.sasxnmis ;
   data foo.test; x=1; y=.; z=3; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Aug 2018 17:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489714#M127935</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-08-24T17:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Working with tagsets to create XML with missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489731#M127945</link>
      <description>&lt;P&gt;Thanks for your Help Chris!&lt;/P&gt;&lt;P&gt;It works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I don't understand the code inside the proc template; Define tagset....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a paper nesug 2008.&amp;nbsp; I hope it will help how to write simple tagset...&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Aug 2018 19:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-tagsets-to-create-XML-with-missing-values/m-p/489731#M127945</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2018-08-24T19:13:49Z</dc:date>
    </item>
  </channel>
</rss>

