<?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: How to update dataset and change the column's length in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93120#M26482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this..hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select catx('|',x,'abcdefghijklmn') as x length =&amp;nbsp; 200,catx('|',y,"abcdefghilklmn") as y length = 200 from one;&lt;/P&gt;&lt;P&gt;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Apr 2012 15:16:39 GMT</pubDate>
    <dc:creator>shivas</dc:creator>
    <dc:date>2012-04-24T15:16:39Z</dc:date>
    <item>
      <title>How to update dataset and change the column's length</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93119#M26481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;if I want upate tabel work.one for its column x and y as below,and want update their length,but there is error happend when I use length= statement in proc sql .&lt;/P&gt;&lt;P&gt;could anyone tell me how to change variable's length when using update in sql procedure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.one;&lt;/P&gt;&lt;P&gt;length x y $5;&lt;/P&gt;&lt;P&gt;x='aaa';&lt;/P&gt;&lt;P&gt;y='bbb';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;update work.one&lt;/P&gt;&lt;P&gt;set x= catx('|',x,'abcdefghijklmn') &lt;STRONG style="text-decoration: underline;"&gt;length x=$200&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,y= catx('|',y"abcdefghilklmn") &lt;STRONG style="text-decoration: underline;"&gt;length y=$200&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 14:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93119#M26481</guid>
      <dc:creator>Mike_Davis</dc:creator>
      <dc:date>2012-04-24T14:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataset and change the column's length</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93120#M26482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this..hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select catx('|',x,'abcdefghijklmn') as x length =&amp;nbsp; 200,catx('|',y,"abcdefghilklmn") as y length = 200 from one;&lt;/P&gt;&lt;P&gt;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 15:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93120#M26482</guid>
      <dc:creator>shivas</dc:creator>
      <dc:date>2012-04-24T15:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataset and change the column's length</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93121#M26483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can't change the length in an update statement, you need to use a create statemen.&amp;nbsp; Update may change in place, create builds a new table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 15:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93121#M26483</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2012-04-24T15:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataset and change the column's length</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93122#M26484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Doc@Duke said, you need another statement to change the length of columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data work.one;
length x y $5;
x='aaa';
y='bbb';
run;

proc sql noprint;
alter table work.one modify x char(200),y char(200);


update work.one
set x= catx('|',x,'abcdefghijklmn') 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,y= catx('|',y,"abcdefghilklmn")
&amp;nbsp; ;
quit;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 03:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-update-dataset-and-change-the-column-s-length/m-p/93122#M26484</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-04-25T03:08:51Z</dc:date>
    </item>
  </channel>
</rss>

