<?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: while reading data from a permanent dataset values are truncating for a specific column in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743504#M961</link>
    <description>&lt;P&gt;I do not have the permanent path details with me to use the cvp.&lt;/P&gt;&lt;P&gt;please let me know the alternate way of the cvp engine instead of libanme.&lt;/P&gt;</description>
    <pubDate>Tue, 25 May 2021 08:27:41 GMT</pubDate>
    <dc:creator>Mastanvali</dc:creator>
    <dc:date>2021-05-25T08:27:41Z</dc:date>
    <item>
      <title>while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743381#M953</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I'm reading a permanent dataset but values are truncating for a specific column. Even after applying length or format or informat statements in SAS viya.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;set milk.apps;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;milk.apps having product column and it contains length 20.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;product column contains value "mástan o' valishaikka"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in ABC product column contains&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"mástan o' valishaikk".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;may I know how sas reading special values?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Only truncating last character value in each record.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 14:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743381#M953</guid>
      <dc:creator>Mastanvali</dc:creator>
      <dc:date>2021-05-24T14:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743387#M954</link>
      <description>##- Since you are reading multi byte character, using k functions like&lt;BR /&gt;klength instead of length should resolve the issue -##</description>
      <pubDate>Mon, 24 May 2021 15:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743387#M954</guid>
      <dc:creator>hhh123</dc:creator>
      <dc:date>2021-05-24T15:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743389#M955</link>
      <description>&lt;P&gt;The values you are hoping to print actually contain 21 printable characters, not 20.&amp;nbsp; Have you tried just removing the format, along the lines of:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
   set milk.apps;
   format product;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 May 2021 15:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743389#M955</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-05-24T15:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743390#M956</link>
      <description>&lt;P&gt;Sounds like you need to use the CVP engine to expand the number of bytes of storage used to store the character strings so that it has enough space to store the multi-byte characters you are using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/8.1/lestmtsref/p1ml1gmtqm3h72n17yjxbyagw0mm.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/vdmmlcdc/8.1/lestmtsref/p1ml1gmtqm3h72n17yjxbyagw0mm.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 15:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743390#M956</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-24T15:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743504#M961</link>
      <description>&lt;P&gt;I do not have the permanent path details with me to use the cvp.&lt;/P&gt;&lt;P&gt;please let me know the alternate way of the cvp engine instead of libanme.&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 08:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743504#M961</guid>
      <dc:creator>Mastanvali</dc:creator>
      <dc:date>2021-05-25T08:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743506#M962</link>
      <description>&lt;P&gt;klength product $20.; /* it is throwing error*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data d;&lt;/P&gt;&lt;P&gt;set milk.app;&lt;/P&gt;&lt;P&gt;asd=klength(product); /* it will give the length of the prodcut variable */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was tried but the statement is throwing error and it is used out of order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any other suggestions.&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 08:45:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743506#M962</guid>
      <dc:creator>Mastanvali</dc:creator>
      <dc:date>2021-05-25T08:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743507#M963</link>
      <description>&lt;P&gt;even after trying also values are getting truncated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any other alternate way please?&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 08:46:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743507#M963</guid>
      <dc:creator>Mastanvali</dc:creator>
      <dc:date>2021-05-25T08:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743526#M965</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/250721"&gt;@Mastanvali&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;klength product $20.; /* it is throwing error*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data d;&lt;/P&gt;
&lt;P&gt;set milk.app;&lt;/P&gt;
&lt;P&gt;asd=klength(product); /* it will give the length of the prodcut variable */&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was tried but the statement is throwing error and it is used out of order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any other suggestions.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;KLENGTH is NOT a statement.&amp;nbsp; There is a KLENGTH() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to put the LENGTH statement as part of the data step.&amp;nbsp; Variables are not some type of free standing object that is independent of the dataset they appear in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make the variable longer than you think you need and see if that helps.&amp;nbsp; Make sure to remove any format attached to the variable so the values are not truncated on printing.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data d;
  length product $40 ;
  format product ;
  set milk.app;
  nbytes = length(product);
  nchars = klength(product);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 12:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743526#M965</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-25T12:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743532#M966</link>
      <description>Even the value is truncating, set it self truncating. Any other suggestions?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 May 2021 12:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743532#M966</guid>
      <dc:creator>Mastanvali</dc:creator>
      <dc:date>2021-05-25T12:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743536#M967</link>
      <description>&lt;P&gt;Please confirm how the libref you are reading from is defined.&amp;nbsp; You mentioned before that you did not know the path. Why? Is it not coming from a SAS dataset?&amp;nbsp; Are you linking to some external database?&amp;nbsp; If so then perhaps the connection path for that is messing up the values before they even get to SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do have a SAS dataset as input you can try doing your own transcoding.&lt;/P&gt;
&lt;P&gt;I think something like this will let you get the raw values from the file and look at them.&lt;/P&gt;
&lt;P&gt;You can use $HEX format to see the actual codes for charactes in the string. You can try using KCVT() function to transform the values between encodings.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set milk.app (encoding=any);
  length utf8 hex $200 ;
  hex = putn(product,cats('$hex,2*length(product),'.'));
  utf8 = kcvt(trim(product),'wlatin1','utf-8');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 May 2021 12:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743536#M967</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-25T12:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743541#M968</link>
      <description>we are reading data from aws or some other external db. we are directly&lt;BR /&gt;using milk.app.&lt;BR /&gt;</description>
      <pubDate>Tue, 25 May 2021 12:50:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743541#M968</guid>
      <dc:creator>Mastanvali</dc:creator>
      <dc:date>2021-05-25T12:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743567#M969</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/250721"&gt;@Mastanvali&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;we are reading data from aws or some other external db. we are directly&lt;BR /&gt;using milk.app.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you are NOT reading from a permanent SAS dataset?&lt;/P&gt;
&lt;P&gt;How is the MILK libref defined?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To seem some information run this statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname milk list;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 May 2021 14:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743567#M969</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-25T14:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: while reading data from a permanent dataset values are truncating for a specific column</title>
      <link>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743618#M970</link>
      <description>Hey sorry for the inconvenience, those are secret libraries. So we don't&lt;BR /&gt;have path with us. those libraries configured in auto.exe files. we are&lt;BR /&gt;using directly.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 May 2021 16:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/while-reading-data-from-a-permanent-dataset-values-are/m-p/743618#M970</guid>
      <dc:creator>Mastanvali</dc:creator>
      <dc:date>2021-05-25T16:40:06Z</dc:date>
    </item>
  </channel>
</rss>

