<?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: Dealing with length when manipulating tables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Dealing-with-length-when-manipulating-tables/m-p/628035#M20629</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12460"&gt;@jklaverstijn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am grateful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 20:16:30 GMT</pubDate>
    <dc:creator>onimisi_esho</dc:creator>
    <dc:date>2020-02-27T20:16:30Z</dc:date>
    <item>
      <title>Dealing with length when manipulating tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dealing-with-length-when-manipulating-tables/m-p/625876#M20297</link>
      <description>&lt;P&gt;I created a table on SAS work.sas_table with 5 columns(3 char and 2 numeric) by running a select query from an external database(hive presto). I got a warning that "&lt;FONT&gt;the following columns could have a lenght in SAS of 32767. if so, SAS performance is impacted.&lt;/FONT&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to work with work.sas_table then got this error: "&lt;FONT&gt;ERROR: Index TEMPINDX cannot be created on file WORK.'SASTMP-000000019'n because the length of the index value (32767 bytes) is too&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; large. The index page size (currently 32767) must be large enough to store three index values plus a small overhead&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; structure. Reduce the length of the index value or use the IBUFSIZE= option to increase the index page size (up to a maximum&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; of 32,767 bytes).&lt;BR /&gt;ERROR: :Unable to create temporary index while processing summary functions.&lt;/FONT&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On checking the properties of wor.sas_table I discovered the the reason for the first error looking at the length&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Length&lt;/TD&gt;&lt;TD&gt;Format&lt;/TD&gt;&lt;TD&gt;Informat&lt;/TD&gt;&lt;TD&gt;Label&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Col 1&lt;/TD&gt;&lt;TD&gt;Character&lt;/TD&gt;&lt;TD&gt;32767&lt;/TD&gt;&lt;TD&gt;$32,767.00&lt;/TD&gt;&lt;TD&gt;$32,767.00&lt;/TD&gt;&lt;TD&gt;month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Col 2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;Numeric&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;msisdn_key&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Col 3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;Numeric&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;smartphones&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Col 4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;Character&lt;/TD&gt;&lt;TD&gt;32767&lt;/TD&gt;&lt;TD&gt;$32,767.00&lt;/TD&gt;&lt;TD&gt;$32,767.00&lt;/TD&gt;&lt;TD&gt;imei&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;tech&lt;/TD&gt;&lt;TD&gt;Character&lt;/TD&gt;&lt;TD&gt;32767&lt;/TD&gt;&lt;TD&gt;$32,767.00&lt;/TD&gt;&lt;TD&gt;$32,767.00&lt;/TD&gt;&lt;TD&gt;tech&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please how do I alter the table and possible reduce the length of the character columns of work.sas_table. Is there a function in SAS I can use? I am running SAS Enterprise&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 15:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dealing-with-length-when-manipulating-tables/m-p/625876#M20297</guid>
      <dc:creator>onimisi_esho</dc:creator>
      <dc:date>2020-02-19T15:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with length when manipulating tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dealing-with-length-when-manipulating-tables/m-p/625879#M20298</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A good approach here is to first create the target table without any data but with the definitions as you want them. Then you run your extract and do a force append of that to the dataset you created. This will make certain you get what you want instead of letting the access engine decide. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/**
 * Step 1: create the target table.
 */
data target;
    attrib col1 length=$10;
    attrib col2 length=$40;
    attrib col3 length=8;
    call missing(col1, col2, col3);
    stop;
run;

/**
 * Step 2: define the source, preferrably as a view.
 */
proc sql;
    create view source as (select col1, col2, col3 from ....);
quit;

/**
 * Step 3: Load the source data into the target table
 */
proc append base=target data=source force;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is a pattern that is typically implemented in the data loader transform in SAS DI Studio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;-- Jan.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 15:47:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dealing-with-length-when-manipulating-tables/m-p/625879#M20298</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2020-02-19T15:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dealing with length when manipulating tables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Dealing-with-length-when-manipulating-tables/m-p/628035#M20629</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12460"&gt;@jklaverstijn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am grateful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 20:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Dealing-with-length-when-manipulating-tables/m-p/628035#M20629</guid>
      <dc:creator>onimisi_esho</dc:creator>
      <dc:date>2020-02-27T20:16:30Z</dc:date>
    </item>
  </channel>
</rss>

