<?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 To Alter a column definition in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24937#M5629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dates;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;informat&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dates &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dates &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;12/1/2011&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;1/1/2012&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;title&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; before change;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;datasets&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;library&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=WORK &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;nolist&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dates &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;title&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; after change;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2012 17:01:40 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2012-01-05T17:01:40Z</dc:date>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24934#M5626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi people,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a small question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to alter a column definition on SAS with no needs to create or overwrite the table&lt;/P&gt;&lt;P&gt;Like in SQL using alter table command?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 16:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24934#M5626</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-01-05T16:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24935#M5627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you trying to change?&amp;nbsp; In SAS, you have the alter table statement in proc sql (see: &lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/viewer.htm#a001395096.htm"&gt;http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/viewer.htm#a001395096.htm&lt;/A&gt; ), as well as proc datasets ( &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000247753.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000247753.htm&lt;/A&gt; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 16:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24935#M5627</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-05T16:37:33Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24936#M5628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi art&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to use the data step statement instead of proc sql.&amp;nbsp; To change the column size that has already been defined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 16:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24936#M5628</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-01-05T16:54:46Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24937#M5629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dates;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;informat&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dates &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dates &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;date9.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;12/1/2011&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;1/1/2012&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;title&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; before change;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;datasets&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;library&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=WORK &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;nolist&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dates &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;title&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; after change;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 17:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24937#M5629</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-05T17:01:40Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24938#M5630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Linlin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, what i'm looking for is to change the definition, because a column in a table has&amp;nbsp; been defined as character length $30. but i need to change to $40. And i would like to know if is possible to use data step&amp;nbsp; instead of proc sql but without creating or overwriting tables?&amp;nbsp; Maybe using proc datasets but not sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not, is ok!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 17:14:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24938#M5630</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-01-05T17:14:58Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24939#M5631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proc Datasets is hard to change column's length. But you can try data step by length statement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data want;&lt;/P&gt;&lt;P&gt;length var1 $ 40;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 17:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24939#M5631</guid>
      <dc:creator>QLi</dc:creator>
      <dc:date>2012-01-05T17:49:46Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24940#M5632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I believe not be possible to change the column's length using data step without the needs of creating a new table or&amp;nbsp; overwrting the same table. am I sure?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 17:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24940#M5632</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-01-05T17:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24941#M5633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I think you're correct. It doesn't appear possible to change the length of a variable without recreating the table. Changing the table structure could change the data if you reduced the length so this makes some sense. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL or PROC DATASETS can be used to change the format but not the length. I thought the modify statement within a datastep might work, but I couldn't get it to work either (though that doesn't mean it can't be).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use a data step and specify the length before you the SET statement as in QLi's code to change the length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: &lt;/P&gt;&lt;P&gt;NOTE in SAS DOCs that say it is a fixed attribute and cannot be changed via proc datasets:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001397456.htm"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001397456.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Via PROC SQL;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;alter table work.class &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; modify sex format=$5.;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Via a datastep;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; length sex $5.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 18:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24941#M5633</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-01-05T18:02:42Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24942#M5634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Even with proc sql is not possible to change the length?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 18:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24942#M5634</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-01-05T18:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24943#M5635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot change the length of a variable without recreating the dataset.&lt;/P&gt;&lt;P&gt;But unless you want to modify the data there is no need to change the length so what is the issue about recreating the dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 18:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24943#M5635</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-01-05T18:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24944#M5636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... yes with SQL, but you still have to read/rewrite the data set &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anything that modifies the data set content rather than just the header (attributes such as variable names, formats, labels) requires a rewrite&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;retain name "mike";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;title 'ORIGINAL';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc contents data=x;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;ods select variables;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;create table x as select name length=10 from x;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;title 'MODIFIED';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;proc contents data=x;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;ods select variables;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;ORIGINAL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;Alphabetic List of Variables and Attributes&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; Variable&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp; Len&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;MODIFIED&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;Alphabetic List of Variables and Attributes&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp; Variable&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp; Len&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 18:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24944#M5636</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-01-05T18:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24945#M5637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can with PROC SQL. I think it just recreates the dataset though or at least read that somewhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;alter table work.class&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; modify sex char(5);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 18:59:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24945#M5637</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-01-05T18:59:44Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24946#M5638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; For one reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a table with 250GB of space that has a column with length $30. It took a long time to be created, Now we realized that we need alter it to length $50 (there are some fields to increase the size and other to get small).&amp;nbsp; So I wouldn't like to recreate this table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But&amp;nbsp; It seems that&amp;nbsp; there is no other way .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 19:25:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24946#M5638</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-01-05T19:25:53Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24947#M5639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you change the length on the table the information in the fields won't change, you should be able to drop the old column and add a new one with the correct defn and update that.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Not sure about the efficiencies of that but someone else may know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 19:36:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24947#M5639</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-01-05T19:36:47Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24948#M5640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Reeza, I know that ("changing the length on the table the information in the fields won't change"). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The length $50. will be used for new values, because the source that we get this information has new values with greater then length $30. Unfortunatelly we defined our column with length $30.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But Ok.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 20:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24948#M5640</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-01-05T20:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24949#M5641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When re-creating the table make sure to use "options compress=yes;"&lt;/P&gt;&lt;P&gt;Network throughput and Disk I/O are very often the bottleneck and I've seen it more than once that using character compression for a table can speed up things quite a bit - especially if there are a lot of character variables with "empty space".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 22:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24949#M5641</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-01-05T22:03:30Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24950#M5642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Augusto&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you know, you are in a difficult position. You cannot increase the width for new values in $30 column, without rewriting the whole table, except....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you "close" the old table and start writing new rows to a new table of the same structure, which has that column defined as $50. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When analysing, read both "old" and "new" through a view (just make sure that the wider definition is found first on the concatenation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL might provide the most "transparent" join of the tables (as it would allow an sql query optimiser to reach through an sql view, to any indexes defined for "old" and "new". This is not possible through a data step view).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this is useful&lt;/P&gt;&lt;P&gt;peterC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 18:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24950#M5642</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2012-01-06T18:01:08Z</dc:date>
    </item>
    <item>
      <title>To Alter a column definition</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24951#M5643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Peter. I hadn't thought about that. You are sure I still have a way out. This was very useful indeed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jan 2012 22:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/To-Alter-a-column-definition/m-p/24951#M5643</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2012-01-06T22:14:21Z</dc:date>
    </item>
  </channel>
</rss>

