<?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 How to change the length of multiple variables in one go in SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318573#M69812</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a requirement of changing length of multiple variables in one go in a sas dataset. I know this can be done by using 'RENAME' statement but I have to do this for over 70 variables. Is there a way to get this done in a much simpler way?&lt;/P&gt;</description>
    <pubDate>Tue, 13 Dec 2016 14:54:17 GMT</pubDate>
    <dc:creator>Vishy</dc:creator>
    <dc:date>2016-12-13T14:54:17Z</dc:date>
    <item>
      <title>How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318573#M69812</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a requirement of changing length of multiple variables in one go in a sas dataset. I know this can be done by using 'RENAME' statement but I have to do this for over 70 variables. Is there a way to get this done in a much simpler way?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 14:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318573#M69812</guid>
      <dc:creator>Vishy</dc:creator>
      <dc:date>2016-12-13T14:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to change lengh of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318574#M69813</link>
      <description>&lt;P&gt;The length is set with a &lt;FONT face="courier new,courier"&gt;length&lt;/FONT&gt; statement. &lt;FONT face="courier new,courier"&gt;rename&lt;/FONT&gt; may help in avoiding certain NOTEs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you determine the future lengths of the variables?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 14:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318574#M69813</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-13T14:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to change lengh of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318577#M69814</link>
      <description>&lt;P&gt;Thanks for response Kurt. All the variables I have got have length of 3 &amp;amp; I need all of them to be changed to length of 5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just trying with the following method, but it's not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; DATASET1;&lt;/P&gt;&lt;P&gt;INPUT VAR1 $3. VAR2 $3. VAR3 $3. VAR4 $3. COL1 $3. COL2 $3. COL3 $3.;&lt;/P&gt;&lt;P&gt;DATALINES;&lt;/P&gt;&lt;P&gt;ABC BBB ASB AAS ATS EES DAS&lt;/P&gt;&lt;P&gt;ASD FDA ASD DAS AEW KJL ASD&lt;/P&gt;&lt;P&gt;AES EWL SAG GLA GKE AKS SAF&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; DATASET2;&lt;/P&gt;&lt;P&gt;SET DATASET1;&lt;/P&gt;&lt;P&gt;LENGTH VAR1-VAR4 $5. COL1-COL3 $5.;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 14:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318577#M69814</guid>
      <dc:creator>Vishy</dc:creator>
      <dc:date>2016-12-13T14:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to change lengh of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318578#M69815</link>
      <description>&lt;P&gt;Put the &lt;FONT face="courier new,courier"&gt;length&lt;/FONT&gt; statement before the &lt;FONT face="courier new,courier"&gt;set&lt;/FONT&gt; statement. With the &lt;FONT face="courier new,courier"&gt;set&lt;/FONT&gt; the data step compiler takes the lengths from the dataset and can't change them thereafter.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 15:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318578#M69815</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-12-13T15:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to change lengh of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318585#M69817</link>
      <description>&lt;P&gt;Well, my question would be why not just:&lt;/P&gt;
&lt;PRE&gt;data dataset1;
  input var1 $5. var2 $5. var3 $5. var4 $5. col1 $5. col2 $5. col3 $5.;
datalines;
ABC BBB ASB AAS ATS EES DAS
ASD FDA ASD DAS AEW KJL ASD
AES EWL SAG GLA GKE AKS SAF
;
run;
&lt;/PRE&gt;
&lt;P&gt;??&lt;/P&gt;
&lt;P&gt;Why is it that data has incorrect lengths in the first place? &amp;nbsp;Fix the problem in the preceeding steps and save yourself the effort. &amp;nbsp;Also note that this change makes no difference char(3) of ABC still equals char(5) of ABC, so not seeing the value.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 15:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318585#M69817</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-12-13T15:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318587#M69818</link>
      <description>&lt;P&gt;As you said you have 70 variables, it is hard to type all the 70 variable names. I'm assuming that you have less variables in the dataset that not needed to change the variable length. Then this code works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;proc&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :names separated by &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dictionary.columns&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; libname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"SASHELP"&lt;/FONT&gt; &lt;FONT color="#008000" face="Courier New" size="3"&gt;/*Library */&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;memname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"CLASS"&lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/*Dataset name*/&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;not&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Height"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Weight"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Age"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/* Variables to exclude for changing the length*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;names;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; one;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;names $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.class;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 15:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318587#M69818</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-12-13T15:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318622#M69830</link>
      <description>&lt;P&gt;Thank you guys for your thoughts. I guess the question was confusing so let me know reframe it correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are over 187 fields in a dataset in which I have to change the lengths for 78 variables from current length 3 to 5. The variable names goes like this. I can change it using the below method but would like to understand if there is any other efficient way to get it done. Typing all 78 variables like is bit tedious process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;AR1_ABC&lt;/TD&gt;
&lt;TD&gt;AR2_ADA&lt;/TD&gt;
&lt;TD&gt;AR3_ASD&lt;/TD&gt;
&lt;TD&gt;AR4_ASDF&lt;/TD&gt;
&lt;TD&gt;AR5_ASDEW&lt;/TD&gt;
&lt;TD&gt;AR6_SDFJ&lt;/TD&gt;
&lt;TD&gt;AR7_EWEK&lt;/TD&gt;
&lt;TD&gt;AR8_ASKE&lt;/TD&gt;
&lt;TD&gt;AR9_ASKWE&lt;/TD&gt;
&lt;TD&gt;AR10_KJREI&lt;/TD&gt;
&lt;TD&gt;AR11_KSKD&lt;/TD&gt;
&lt;TD&gt;AR12_KDFL&lt;/TD&gt;
&lt;TD&gt;AR13_LSI&lt;/TD&gt;
&lt;TD&gt;AR14_KSK&lt;/TD&gt;
&lt;TD&gt;AR15_SKE&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DATASET2;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;LENGTH&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR1_ABC &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR2_ADA &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR3_ASD &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR4_ASDF &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;AR5_ASDEW &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR6_SDFJ &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR7_EWEK &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR8_ASKE &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR9_ASKWE &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR10_KJREI &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;SET&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;DATASET1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 17:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318622#M69830</guid>
      <dc:creator>Vishy</dc:creator>
      <dc:date>2016-12-13T17:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318640#M69836</link>
      <description>&lt;P&gt;Well, you have really hit one of the reasons why most DB's, and a fair few standard data models work with normalised data rather than transposed data. &amp;nbsp;Personally, I would never have more than 20-30 variables in any one dataset. &amp;nbsp;Its just unweildy as you are finding. &amp;nbsp;Sure you could write some funky code to pull out metadata then generate code, or you could use arrays, at the end of the day you are going to have to do this on every process which bloats your coding effort at every level, and you lose most of the by group functionality. &amp;nbsp;You have also modelled your data in such a way as to not be able to use lists of variables (and set arrays easily), as you don't have the &amp;lt;variable&amp;gt;&amp;lt;suffix number&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now on top of the above data modelling discussion, the question still remains why the need to change the length at all. Is it because of processing later on? &amp;nbsp;If so then just include it there. &amp;nbsp;If thats how you import the data, change your import process to get lengths as you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now in your code, you don't need to repeat the $5 each time:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;LENGTH&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR1_ABC &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;AR2_ADA &lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;AR3_ASD &lt;FONT color="#008080"&gt;...&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;AR10_KJREI &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;$5&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Note, coding in upcase really makes code harder to read. &amp;nbsp;You will see in the above you only specify $5 once at the end. &amp;nbsp;If ar1_abc is positionally first in the dataset and ar10_kjrei is the last, and you want to change all between those positional variables, then you could simplify to:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;LENGTH&lt;/FONT&gt; AR1_ABC--AR10_KJREI &lt;FONT face="Courier New" size="3" color="#008080"&gt;$5&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;This means all variables between first specified and last specified.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;But its all overshadowed by the simplicity of changing to a normalised structure.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 17:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318640#M69836</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-12-13T17:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318684#M69850</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Courier New" size="3"&gt;Using dictionary tables makes your task easier.&lt;BR /&gt;Instead of typing all the variable names it's easy to type the "VARNUM" numbers for the corresponding&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;variables.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;/&lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="3"&gt;* Here I have 10 variables and I need to change the length for only some of the variables */&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; one;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;infile&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR1_ABC &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR2_ADA &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR3_ASD &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR4_ASDF &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;AR5_ASDEW &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR6_SDFJ &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR7_EWEK &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR8_ASKE &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR9_ASKWE &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; AR10_KJREI &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ABC BBB ASB AAS ATS EES DAS ASD FDA ASD&lt;/P&gt;&lt;P&gt;DAS AEW KJL ASD AES EWL SAG GLA GKE AKS&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;/* Find the VARNUM numbers for the variables that you want to change the length from dictionary tables*/&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; *&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dictionary.columns&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; libname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"WORK"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; memname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"ONE"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;/* Put all the variable names that you want to change the length in a macro */&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :names separated by &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dictionary.columns&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; libname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"WORK"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; memname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"ONE"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; varnum &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;in&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;9&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;names;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; :names_retain separated by &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dictionary.columns&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; libname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"WORK"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; memname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"ONE"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;names_retain;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; two;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;retain&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;names_retain;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &amp;amp;names &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; one;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2016 20:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318684#M69850</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-12-13T20:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318748#M69879</link>
      <description>&lt;P&gt;Try SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA DATASET1;
INPUT VAR1 $3. VAR2 $3. VAR3 $3. VAR4 $3. COL1 $3. COL2 $3. COL3 $3.;
DATALINES;
ABC BBB ASB AAS ATS EES DAS
ASD FDA ASD DAS AEW KJL ASD
AES EWL SAG GLA GKE AKS SAF
;
RUN;
data _null_;
 set sashelp.vcolumn(keep=libname memname type name
where=(libname='WORK' and memname='DATASET1' and type='char')) end=last;
 if _n_=1 then call execute('proc sql;alter table dataset1 modify');
 call execute(name||' char(5)');
 if last then call execute(';quit;');
  else call execute(',');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Dec 2016 03:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318748#M69879</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-12-14T03:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318805#M69900</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, it's working from both the methods. Thanks a lot for your contributions &amp;amp; help on this. I really appreciate it. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 10:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318805#M69900</guid>
      <dc:creator>Vishy</dc:creator>
      <dc:date>2016-12-14T10:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318989#M69957</link>
      <description>&lt;P&gt;Ksharp,&amp;nbsp;thanks for very much for&amp;nbsp;the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we apply the format and informat in the method you have mentioned?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; DATASET1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;INPUT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; VAR1 VAR2 VAR3 VAR4 COL1 COL2 COL3 &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;$3.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATALINES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ABC BBB ASB AAS ATS EES DAS&lt;/P&gt;&lt;P&gt;ASD FDA ASD DAS AEW KJL ASD&lt;/P&gt;&lt;P&gt;AES EWL SAG GLA GKE AKS SAF&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; sashelp.vcolumn(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=libname memname type name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(libname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'WORK'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; and memname=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'DATASET1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; and &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;type&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'char'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=last;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; _n_=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; execute(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'proc sql;alter table dataset1 modify'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; execute(name||&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' char(5)'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; last &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; execute(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;';quit;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; call execute(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;','&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 16:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/318989#M69957</guid>
      <dc:creator>Vishy</dc:creator>
      <dc:date>2016-12-14T16:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/319176#M70024</link>
      <description>&lt;PRE&gt;
Sure. The following cod make all the character variables have $20. format.


DATA DATASET1;
INPUT VAR1 $3. VAR2 $3. VAR3 $3. VAR4 $3. COL1 $3. COL2 $3. COL3 $3.;
DATALINES;
ABC BBB ASB AAS ATS EES DAS
ASD FDA ASD DAS AEW KJL ASD
AES EWL SAG GLA GKE AKS SAF
;
RUN;



data _null_;
 set sashelp.vcolumn(keep=libname memname type name
where=(libname='WORK' and memname='DATASET1' and type='char')) end=last;
 if _n_=1 then 
call execute('proc datasets library=work nolist nodetails;modify dataset1;format');
 call execute(name);
 if last then call execute(' $20.;quit;');
run;


&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2016 07:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/319176#M70024</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-12-15T07:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the length of multiple variables in one go in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/319207#M70042</link>
      <description>&lt;P&gt;Great. It works, thank you very much Ksharp..I appreciate it.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 09:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-change-the-length-of-multiple-variables-in-one-go-in-SAS/m-p/319207#M70042</guid>
      <dc:creator>Vishy</dc:creator>
      <dc:date>2016-12-15T09:58:25Z</dc:date>
    </item>
  </channel>
</rss>

