<?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: Changing variable length without creating a new dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168003#M263976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since both do a sequential read/write of the table, comparative performance should not be an issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Apr 2014 06:06:20 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2014-04-04T06:06:20Z</dc:date>
    <item>
      <title>Changing variable length without creating a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/167999#M263972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is possible to change variable length without creating a new dataset using proc dataset or sql?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;datasets&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;library&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;=work &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;nolist&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; datset&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;format variabe $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;length variable &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;10&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;Proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;alter&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; dataset&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; variabe format = $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;modify&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; length variable &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;10&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2014 21:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/167999#M263972</guid>
      <dc:creator>sasthebest</dc:creator>
      <dc:date>2014-04-03T21:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Changing variable length without creating a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168000#M263973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately there is no way to modify the length of a variable using the proc datasets modify function, however on the bright side you can use it to alter the format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;attrib var1 format = $15.;&lt;/P&gt;&lt;P&gt;var1 = '1234567890';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=have;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets library=work nolist;&lt;/P&gt;&lt;P&gt;modify have;&lt;/P&gt;&lt;P&gt;format var1 $4.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=have;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2014 23:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168000#M263973</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-04-03T23:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Changing variable length without creating a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168001#M263974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changing variable attributes like format and informat needs only a change of the descriptor part of a data set. This can be done by either Proc Datasets or Proc SQL Alter table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For&amp;nbsp; changing the variable length the data set needs to be re-written as this also changes how the data gets physically stored (more or less space required). This can not be done using Proc Datasets but it can be done using PROC SQL ALTER TABLE / MODIFY. Be aware that if you change the length the full data set gets re-written so this could take a bit of time for a big table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 02:49:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168001#M263974</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-04-04T02:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Changing variable length without creating a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168002#M263975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does the SQL method compare efficiency wise to using a Datastep?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 03:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168002#M263975</guid>
      <dc:creator>Scott_Mitchell</dc:creator>
      <dc:date>2014-04-04T03:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing variable length without creating a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168003#M263976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since both do a sequential read/write of the table, comparative performance should not be an issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 06:06:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168003#M263976</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-04-04T06:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Changing variable length without creating a new dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168004#M263977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SQL approach will maintain all table attributes like indexes so it's imho the cleanest way of coding a change of variable lengths. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 06:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-variable-length-without-creating-a-new-dataset/m-p/168004#M263977</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-04-04T06:36:01Z</dc:date>
    </item>
  </channel>
</rss>

