<?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 Mask Unicode: 0x1a character. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Mask-Unicode-0x1a-character/m-p/154194#M30244</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Have issue with XML created from SAS , will be appreciate for any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I create XML from SAS using standard libname engine:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;filLibName &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;"...temp.xml"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;LIBNAME&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;filLibName XML&amp;nbsp; XMLTYPE=GENERIC &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;filLibName.&lt;STRONG&gt;.TEST&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;_XML;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; TEST_DATA;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Then XML goes to validation on java side.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;For majority of data validation pass ok, without issue,b&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;ut for some set of data issue occurs, and XML rejects with reason:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 9pt; font-family: 'Segoe UI';"&gt;An invalid XML character (Unicode: 0x1a) was found in the element content of the document.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like some invalid character come with SAS data and java validation tool reject XML due this character.&lt;/P&gt;&lt;P&gt;XML should be in UNICODE format so I tried to changed libname to :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;LIBNAME&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;filLibName XML&amp;nbsp; XMLTYPE=GENERIC XMLENCODING=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'utf8'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;And this step changed XML header to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;.&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Some special character occurs before first tag and it again crashed validation on java side, so I changed it in code(just hardcoding), so XML header after this looks like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;But the problem still exists, XML message still rejects with same error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;I browsed and found that java developers fixed this issue simply by replacing this char to another allowed character:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;A href="http://stackoverflow.com/questions/8505816/streamexception-an-invalid-xml-character-unicode-0x1a"&gt;http://stackoverflow.com/questions/8505816/streamexception-an-invalid-xml-character-unicode-0x1a&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;It's also ok for me, but I should realize it on SAS and I actually can't find this character in SAS table,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;so queston is if there are some smart way to search and replace this symbol in SAS data?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Maybe there are also some way to predict similar issues?I supposed enough should be set option&amp;nbsp; &lt;/SPAN&gt;XMLENCODING=&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'utf8' &lt;/SPAN&gt;to libname, but as I experienced it's not enough.&lt;/P&gt;&lt;P&gt;I'm using SAS 9.1.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Mar 2014 13:47:19 GMT</pubDate>
    <dc:creator>Yura2301</dc:creator>
    <dc:date>2014-03-24T13:47:19Z</dc:date>
    <item>
      <title>Mask Unicode: 0x1a character.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mask-Unicode-0x1a-character/m-p/154194#M30244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Have issue with XML created from SAS , will be appreciate for any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I create XML from SAS using standard libname engine:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;filLibName &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;"...temp.xml"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;LIBNAME&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;filLibName XML&amp;nbsp; XMLTYPE=GENERIC &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;filLibName.&lt;STRONG&gt;.TEST&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;_XML;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; TEST_DATA;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Then XML goes to validation on java side.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;For majority of data validation pass ok, without issue,b&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;ut for some set of data issue occurs, and XML rejects with reason:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000; font-size: 9pt; font-family: 'Segoe UI';"&gt;An invalid XML character (Unicode: 0x1a) was found in the element content of the document.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like some invalid character come with SAS data and java validation tool reject XML due this character.&lt;/P&gt;&lt;P&gt;XML should be in UNICODE format so I tried to changed libname to :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;LIBNAME&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &amp;amp;filLibName XML&amp;nbsp; XMLTYPE=GENERIC XMLENCODING=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'utf8'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;And this step changed XML header to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;.&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Some special character occurs before first tag and it again crashed validation on java side, so I changed it in code(just hardcoding), so XML header after this looks like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;But the problem still exists, XML message still rejects with same error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;I browsed and found that java developers fixed this issue simply by replacing this char to another allowed character:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;A href="http://stackoverflow.com/questions/8505816/streamexception-an-invalid-xml-character-unicode-0x1a"&gt;http://stackoverflow.com/questions/8505816/streamexception-an-invalid-xml-character-unicode-0x1a&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;It's also ok for me, but I should realize it on SAS and I actually can't find this character in SAS table,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;so queston is if there are some smart way to search and replace this symbol in SAS data?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;Maybe there are also some way to predict similar issues?I supposed enough should be set option&amp;nbsp; &lt;/SPAN&gt;XMLENCODING=&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 10pt;"&gt;'utf8' &lt;/SPAN&gt;to libname, but as I experienced it's not enough.&lt;/P&gt;&lt;P&gt;I'm using SAS 9.1.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 13:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mask-Unicode-0x1a-character/m-p/154194#M30244</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2014-03-24T13:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Mask Unicode: 0x1a character.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mask-Unicode-0x1a-character/m-p/154195#M30245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since it only happens for some of the data I suspect that the value is actually in the data.&lt;/P&gt;&lt;P&gt;You could try check the character variables in your data sets and eliminate the characters it does not like before writing it to the XML file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 14:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mask-Unicode-0x1a-character/m-p/154195#M30245</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-03-24T14:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Mask Unicode: 0x1a character.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Mask-Unicode-0x1a-character/m-p/154196#M30246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;It was my initial idea, but the problem isn't so obvious probably.&lt;/P&gt;&lt;P&gt;I have small SAS table with ~20 rows.&lt;/P&gt;&lt;P&gt;When I send whole this table - issue occurs.&lt;/P&gt;&lt;P&gt;When I eliminate one row - issue doesn't occurs, but then, if I resend this one row - issue also doesn't occurs.&lt;/P&gt;&lt;P&gt;This character probably isn't visible:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=0x"&gt;http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=0x&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I can't just visually separate it in data.&lt;/P&gt;&lt;P&gt;I'm actually a little bit confused why the issue is happend and if this spec character at all is in SAS data, maybe it occurs on stage when SAS create XML from SAS table.&lt;/P&gt;&lt;P&gt;I also tried to find this char directly in XML file via n++, but can't see it also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 14:19:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Mask-Unicode-0x1a-character/m-p/154196#M30246</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2014-03-24T14:19:36Z</dc:date>
    </item>
  </channel>
</rss>

