<?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 Increase the length of a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771059#M244624</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have many SAS dataset on SPDS server&amp;nbsp; with billions of records and i would like to increase the lenght of a variable.&lt;/P&gt;
&lt;P&gt;I have a variable name &lt;CODE class=" language-sas"&gt;PisteAudit &lt;/CODE&gt;with lenght 100 and i would like to increase to 240.&lt;/P&gt;
&lt;P&gt;By using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	alter table lib.table_065
	modify PisteAudit char(240);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it takes several hours to complete. Is there an easier way to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Wed, 29 Sep 2021 03:16:10 GMT</pubDate>
    <dc:creator>foxrol94</dc:creator>
    <dc:date>2021-09-29T03:16:10Z</dc:date>
    <item>
      <title>Increase the length of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771059#M244624</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have many SAS dataset on SPDS server&amp;nbsp; with billions of records and i would like to increase the lenght of a variable.&lt;/P&gt;
&lt;P&gt;I have a variable name &lt;CODE class=" language-sas"&gt;PisteAudit &lt;/CODE&gt;with lenght 100 and i would like to increase to 240.&lt;/P&gt;
&lt;P&gt;By using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	alter table lib.table_065
	modify PisteAudit char(240);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it takes several hours to complete. Is there an easier way to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 03:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771059#M244624</guid>
      <dc:creator>foxrol94</dc:creator>
      <dc:date>2021-09-29T03:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Increase the length of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771061#M244625</link>
      <description>&lt;P&gt;No.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Increasing the length of a variable in a dataset that is already that large is of no value.&lt;/P&gt;
&lt;P&gt;Increasing the length will not make any difference until you make a NEW dataset that contains NEW information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So just make the new dataset that you want.&amp;nbsp; You can then define the variable to have the right length before you populate it with values.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 04:43:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771061#M244625</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-29T04:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Increase the length of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771068#M244630</link>
      <description>&lt;P&gt;I guess if you really need to increase the length of the variable in order to store new values without truncation then I "fear" what you're doing is how you need to do it.&lt;/P&gt;
&lt;P&gt;Assuming there is also security and other stuff defined for your table I'm not so sure if just creating a new table is the way to go with SPDS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;Based on some of your past posts I believe you've got real-live experience with SPDS. Any advice?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 09:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771068#M244630</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-09-29T09:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Increase the length of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771090#M244641</link>
      <description>&lt;P&gt;Changing the structure of a dataset always requires a complete rewrite. Since you do this in place, both read and write operations happen on the same hardware, which slows the process down even further.&lt;/P&gt;
&lt;P&gt;What is the reason for this? All you get is a lot of empty space anyway.&lt;/P&gt;
&lt;P&gt;Are the datasets stored with the COMPRESS=YES option? If not, try this, as it will greatly reduce the write I/O, and subsequent reads of the datasets.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 08:47:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771090#M244641</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-29T08:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Increase the length of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771142#M244672</link>
      <description>&lt;P&gt;There's definitely an easier way, surely not a _faster_ way though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We wrote a macro to avoid the need for you to produce boilerplate:&amp;nbsp;&amp;nbsp;&lt;A href="https://core.sasjs.io/mp__updatevarlength_8sas.html" target="_blank"&gt;https://core.sasjs.io/mp__updatevarlength_8sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The nice thing about the macro is that it will drop and recreate constraints if it's a key variable (it will also avoid the rewrite if you choose the same length)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 14:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Increase-the-length-of-a-variable/m-p/771142#M244672</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2021-09-29T14:10:49Z</dc:date>
    </item>
  </channel>
</rss>

