<?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: Unicode Output in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53006#M14616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why sorry?&amp;nbsp; You got the answer to your question and, better yet, shared it with the rest of us.&amp;nbsp; Mark your last post as the one that had the correct answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2011 21:49:19 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-11-28T21:49:19Z</dc:date>
    <item>
      <title>Unicode Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53000#M14610</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;&lt;/P&gt;&lt;P&gt;I have been asked to output a file (just text) in Unicode (UTF-8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work02; &lt;/P&gt;&lt;P&gt;file "&amp;amp;outfile" encoding="utf-8" notitles lrecl=400; &lt;/P&gt;&lt;P&gt;set work01; &lt;/P&gt;&lt;P&gt;text1 = compress(text,'"');&lt;/P&gt;&lt;P&gt;put @001 text1 $utf8x400.;&amp;nbsp; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it seems to run OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I look at the resulting file, there only seems to be a couple of funny characters at the biginning of the first record and nothing else different.&amp;nbsp; How can I confirm that the results are in Unicode format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 19:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53000#M14610</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2011-11-22T19:26:08Z</dc:date>
    </item>
    <item>
      <title>Unicode Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53001#M14611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are some examples at: &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000211297.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000211297.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One easy test would simply be to reverse the process, i.e., to import the resulting file using the same encoding (i.e., utf-8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, if the file is really comprised of multiple fields, I would think that you would have to have exported it as multiple fields in order for the end user to be able to accurately treat it as being in unicode format.&amp;nbsp; My limited experience (1 time) dealing with that format was with a file that contained nulls between every field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2011 19:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53001#M14611</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-22T19:40:01Z</dc:date>
    </item>
    <item>
      <title>Unicode Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53002#M14612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All the 7-bit ascii characters are also valid utf-8 encoded unicode characters -- utf-8 encoding scheme was specifically designed to be this way. As long as your input characters are ascii (no extended characters), your output should be the same. hth.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 14:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53002#M14612</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2011-11-23T14:37:08Z</dc:date>
    </item>
    <item>
      <title>Unicode Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53003#M14613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all the suggestions....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now - another (minor) issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I remove the trailing blanks from the output record written in the Unicode format (as noted above).&amp;nbsp; The client wants the trailing blanks removed...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use just "$utf8x." as the output format, the default length is 8 chars. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 19:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53003#M14613</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2011-11-28T19:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53004#M14614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not think that you need to use the $utf8x format. The ENCODING option on the FILE statement should be enough.&amp;nbsp; You can use the $VARYING format to write varying lengths to the output file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P style="background-color: #eef4f9;"&gt;data _null_;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; file "&amp;amp;outfile" encoding="utf-8" lrecl=400;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; set work01;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; text1 = compress(text,'"');&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; len=length(text1);&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; put text1 $varying400. len; &lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note the two bytes at the beginning of the file is the signal to SAS and other programs what encoding is being used.&amp;nbsp; Try different encodings and you should see different values in those first two bytes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 19:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53004#M14614</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-11-28T19:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53005#M14615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry - but I have to answer my own question here.... (after a call to SAS).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just adding the format modifier ":" (full colon) before the unicode output format worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the format becomes&amp;nbsp; ":$utf8x400." &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 19:28:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53005#M14615</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2011-11-28T19:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unicode Output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53006#M14616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why sorry?&amp;nbsp; You got the answer to your question and, better yet, shared it with the rest of us.&amp;nbsp; Mark your last post as the one that had the correct answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2011 21:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Unicode-Output/m-p/53006#M14616</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-11-28T21:49:19Z</dc:date>
    </item>
  </channel>
</rss>

