<?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: UTF 8 data truncation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632974#M187730</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182470"&gt;@helannivas88&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks Ksharp for the info.&lt;BR /&gt;But we are using proc sql to connect to the data source as like below&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to DB2 (datasrc=&amp;amp;Datasrc AUTHDOMAIN="ABC") ;&lt;BR /&gt;create table WORK.TEMP_ABC as&lt;BR /&gt;select&lt;BR /&gt;upcase(trim(kleft(ColA))) as ColA&lt;BR /&gt;);&lt;BR /&gt;disconnect from DB2;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;We dont store the data in the permanent dataset. Its just a work dataset and then finally append into the database.&lt;BR /&gt;&lt;BR /&gt;Where to use CVPmulitpler option in the proc sql?&lt;BR /&gt;&lt;BR /&gt;THanks&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your SQL code is incomplete. Please post the complete code for diagnosis.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Mar 2020 14:53:30 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-03-18T14:53:30Z</dc:date>
    <item>
      <title>UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632877#M187686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently we have defined SAS encoding for one of the Level (out of 5) as UTF 8 . All others are in latin - 9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in the UTF - 8 session, when I tried to extract the data from different data source from SAS , the data gets truncated in the sas dataset. We have identified that the values which got truncated has special characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have defined the logic for extraction as upcase(trim(left(ColumnA))). But when I remove the upcase in the logic , then I dont see any problem and no data truncation is happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I dont understand about the UTF - 8 and upcase dependency on the data truncation ??&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should I need to remove the upcase for these scenario?? Please let me know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 08:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632877#M187686</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-03-18T08:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632889#M187690</link>
      <description>&lt;P&gt;When working with multi-byte char-variables, you have to use the k-functions (ktrim, kupcase etc.), because only those function are capable of handling chars that need more than one byte to be stored correctly.&lt;/P&gt;
&lt;P&gt;Yes, this is pure pain.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 09:24:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632889#M187690</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-03-18T09:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632890#M187691</link>
      <description>&lt;P&gt;What is your data source?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 09:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632890#M187691</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-18T09:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632912#M187699</link>
      <description>&lt;P&gt;Try CVP engine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname x cvp 'c:\temp' CVPMULTIPLIER=2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Mar 2020 11:14:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632912#M187699</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-03-18T11:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632957#M187713</link>
      <description>Db2 is the data source</description>
      <pubDate>Wed, 18 Mar 2020 13:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632957#M187713</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-03-18T13:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632964#M187716</link>
      <description>&lt;P&gt;Please show more details about how you are transferring the data from your remote database into SAS.&lt;/P&gt;
&lt;P&gt;I doubt if the UPCASE() function by itself is the real issue, but its might perhaps cause SAS to use a different sequence of operations that could result in truncation.&lt;/P&gt;
&lt;P&gt;The reason you might get truncation is that you could have characters that requires only one byte in LATIN-9, but requires two or more bytes in UTF-8.&amp;nbsp; Perhaps by converting to uppercase you are introducing such a character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You probably just&amp;nbsp; need to make your variable(s) longer to allow room for the extra bytes.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 13:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632964#M187716</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-18T13:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632972#M187717</link>
      <description>Thanks Ksharp for the info.&lt;BR /&gt;But we are using proc sql to connect to the data source as like below&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to DB2  (datasrc=&amp;amp;Datasrc AUTHDOMAIN="ABC") ;&lt;BR /&gt;       create table WORK.TEMP_ABC as&lt;BR /&gt;select&lt;BR /&gt;upcase(trim(kleft(ColA))) as ColA&lt;BR /&gt;);&lt;BR /&gt;disconnect from DB2;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;We dont store the data in the permanent dataset. Its just a work dataset and then finally append into the database.&lt;BR /&gt;&lt;BR /&gt;Where to use CVPmulitpler option in the proc sql?&lt;BR /&gt;&lt;BR /&gt;THanks&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Mar 2020 14:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632972#M187717</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-03-18T14:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632974#M187730</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182470"&gt;@helannivas88&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks Ksharp for the info.&lt;BR /&gt;But we are using proc sql to connect to the data source as like below&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;connect to DB2 (datasrc=&amp;amp;Datasrc AUTHDOMAIN="ABC") ;&lt;BR /&gt;create table WORK.TEMP_ABC as&lt;BR /&gt;select&lt;BR /&gt;upcase(trim(kleft(ColA))) as ColA&lt;BR /&gt;);&lt;BR /&gt;disconnect from DB2;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;We dont store the data in the permanent dataset. Its just a work dataset and then finally append into the database.&lt;BR /&gt;&lt;BR /&gt;Where to use CVPmulitpler option in the proc sql?&lt;BR /&gt;&lt;BR /&gt;THanks&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your SQL code is incomplete. Please post the complete code for diagnosis.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 14:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632974#M187730</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-18T14:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: UTF 8 data truncation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632981#M187733</link>
      <description>&lt;P&gt;Please find the sas code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;connect to DB2 as SRC (datasrc=&amp;amp;Datasrc AUTHDOMAIN="ABC") ;&lt;BR /&gt;create table WORK.TEMP as&lt;BR /&gt;select &lt;BR /&gt;Upcase(trim(left(MSG_DESC))) as MSG_DESC,&lt;BR /&gt;MONOTONIC() as ROW_NUM,&lt;BR /&gt;input("&amp;amp;SYSDATE9 &amp;amp;SYSTIME",DATETIME25.6) as LOADTM format=DATETIME25.6 informat=DATETIME25.6&lt;BR /&gt;from&lt;BR /&gt;(&lt;BR /&gt;select * from connection to SRC&lt;BR /&gt;(&lt;BR /&gt;select * from &amp;amp;Schema..TABLENAME&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;disconnect from SRC;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc append data=WORK.TEMP base=STG.STG_TAB&lt;BR /&gt;(&lt;BR /&gt;BULKLOAD=YES &lt;BR /&gt;BL_METHOD=CLILOAD&lt;BR /&gt;);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 15:05:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/UTF-8-data-truncation/m-p/632981#M187733</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-03-18T15:05:40Z</dc:date>
    </item>
  </channel>
</rss>

