<?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: Table created in UTF-8 session still Latin1 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736682#M229542</link>
    <description>&lt;P&gt;Thanks for the reply. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code runs every night as part of a scheduled batch job. &amp;nbsp;PROC CONTENTS shows me that the table was created within the past 24 hours, and yet it remains Latin1. &amp;nbsp;Could the system user that’s running the code be accessing SAS with a Latin1 session encoding?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should probably just delete the table, in which case it would probably get created as UTF-8 on the next run, but it drives me nuts when the system is behaving in an unexpected manner and I can’t figure out why.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Apr 2021 21:41:53 GMT</pubDate>
    <dc:creator>rtbuttram</dc:creator>
    <dc:date>2021-04-23T21:41:53Z</dc:date>
    <item>
      <title>Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736664#M229533</link>
      <description>&lt;P&gt;This is more of a curiosity question than a problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that gets created every night in our SAS Grid environment using a data step like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data lib.tabl;
     length type $ 15;
     length descript $ 9;
     input type $ descript $;
     infile datalines delimiter=',';
     datalines;
&amp;lt;&amp;lt;imagine datalines here&amp;gt;&amp;gt;
;&lt;/PRE&gt;&lt;P&gt;This code has been running for over a year with no issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently our SAS environment switched from Latin1 to UTF-8 session encoding. &amp;nbsp;I’ve noticed the table created by the above code still shows “latin1 Western (ISO)” as the Encoding scheme in PROC CONTENTS. &amp;nbsp;I would have expected the encoding to change to UTF-8 once our environment session encoding was changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’ve tried to reproduce this behavior by intentionally creating a table with Latin1 encoding and then replacing its contents with a data step such as the above, but the result is always a table with UTF-8 encoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any idea why this older table remains in Latin1 after the change to our session encoding? &amp;nbsp;Again, more a curiosity question than a problem, as I have no need to store mutli-byte characters is this table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 20:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736664#M229533</guid>
      <dc:creator>rtbuttram</dc:creator>
      <dc:date>2021-04-23T20:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736669#M229535</link>
      <description>&lt;P&gt;If you haven't rerun the code to rebuild the table it would maintain the encoding it had when created. It isn't clear whether you have actually rerun that data step to create the table again.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 21:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736669#M229535</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-23T21:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736682#M229542</link>
      <description>&lt;P&gt;Thanks for the reply. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code runs every night as part of a scheduled batch job. &amp;nbsp;PROC CONTENTS shows me that the table was created within the past 24 hours, and yet it remains Latin1. &amp;nbsp;Could the system user that’s running the code be accessing SAS with a Latin1 session encoding?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should probably just delete the table, in which case it would probably get created as UTF-8 on the next run, but it drives me nuts when the system is behaving in an unexpected manner and I can’t figure out why.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 21:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736682#M229542</guid>
      <dc:creator>rtbuttram</dc:creator>
      <dc:date>2021-04-23T21:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736699#M229552</link>
      <description>&lt;P&gt;From what you describe it looks like "something" is overwriting the session encoding. It could be the dataset encoding option or the libname outencoding option.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 01:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736699#M229552</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-04-24T01:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736703#M229554</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;Could the system user that’s running the code be accessing SAS with a Latin1 session encoding?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;That's the first thing I'd look at: What's the configuration used by this batch job?&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 02:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736703#M229554</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-04-24T02:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736735#M229575</link>
      <description>Yeah. I meet the same problem too . Try option:&lt;BR /&gt;&lt;BR /&gt;data lib.tabl(encoding='utf8')  ;</description>
      <pubDate>Sat, 24 Apr 2021 10:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736735#M229575</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-04-24T10:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736753#M229585</link>
      <description>&lt;P&gt;Ok.&amp;nbsp; I *think* I've got a handle on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Earlier I said I had tried to reproduce the behavior by intentionally creating a table in latin1 and then trying to recreate it to see if it remained latin1.&amp;nbsp; That wasn't exactly what I did.&amp;nbsp; I actually uploaded a latin1 dataset that had been created on a &lt;EM&gt;Windows&lt;/EM&gt; host, and then attempted to recreate it in a Linux environment.&amp;nbsp; That reliably results in a new table being created with utf-8 encoding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I create a table in my Linux session with latin1 encoding by using the encoding= data step option, and then replace that table in a separate data step without specifying an encoding option, SAS recognizes the encoding of the pre-existing dataset and uses CEDA to transcode the data from utf-8 to latin1, recreating the table in its original latin1 encoding.&amp;nbsp; Interestingly, the structure of the new dataset can be entirely different from that of the pre-existing dataset.&amp;nbsp; The key seems to be the encoding attribute of pre-existing dataset, and the fact that the pre-existing dataset was created using a data representation that is CEDA compatible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found the following CEDA documentation that seems to address this phenomen:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/lrcon/9.4/n0oj2nagtyy32yn17pj01t6vytaw.htm#p0ovubn20byfw2n1c2hahubw9qos" target="_blank" rel="noopener"&gt;SAS Help Center: SAS File Processing with CEDA&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: inherit; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;"&gt;Thanks to everyone for their input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 15:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736753#M229585</guid>
      <dc:creator>rtbuttram</dc:creator>
      <dc:date>2021-04-24T15:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736754#M229586</link>
      <description>&lt;P&gt;One of the side effects of the macro I present at SASGF21 is that it prevents such behavior. In our batch jobs, result tables are always removed physically (if they exist) before being written out.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 16:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736754#M229586</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-24T16:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736791#M229603</link>
      <description>Thanks Kurt. I’ll be sure to check out your session.&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;Bob</description>
      <pubDate>Sat, 24 Apr 2021 23:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736791#M229603</guid>
      <dc:creator>rtbuttram</dc:creator>
      <dc:date>2021-04-24T23:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Table created in UTF-8 session still Latin1</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736812#M229616</link>
      <description>&lt;P&gt;It's just a 15-minute "quick tip" type session.&lt;/P&gt;
&lt;P&gt;Since I do not have a grid available, it would be nice to know if it can be implemented there in a reasonable fashion (either by using FDELETE() or the external rm -f).&lt;/P&gt;</description>
      <pubDate>Sun, 25 Apr 2021 08:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Table-created-in-UTF-8-session-still-Latin1/m-p/736812#M229616</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-25T08:10:53Z</dc:date>
    </item>
  </channel>
</rss>

