<?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 change the length of multiple variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597325#M172092</link>
    <description>&lt;P&gt;I have data with over 50 variables coded as 0-1. How do I specifically change the length of those variables without changing the other variables?&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; wide&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; enrolid x1&lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt; x2 &lt;SPAN class="token punctuation"&gt;$ date1 date2 time&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;1233   1 1 01/01/2012   . 111
4444  1 1  02/02/2012   .  33
666   0 1   .        02/03/2012  11
6666   0 1   03/03/2012 04/01/2012 11&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2019 13:55:55 GMT</pubDate>
    <dc:creator>lillymaginta</dc:creator>
    <dc:date>2019-10-17T13:55:55Z</dc:date>
    <item>
      <title>change the length of multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597325#M172092</link>
      <description>&lt;P&gt;I have data with over 50 variables coded as 0-1. How do I specifically change the length of those variables without changing the other variables?&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; wide&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; enrolid x1&lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt; x2 &lt;SPAN class="token punctuation"&gt;$ date1 date2 time&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;1233   1 1 01/01/2012   . 111
4444  1 1  02/02/2012   .  33
666   0 1   .        02/03/2012  11
6666   0 1   03/03/2012 04/01/2012 11&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 13:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597325#M172092</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2019-10-17T13:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: change the length of multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597331#M172096</link>
      <description>&lt;P&gt;You can not change the length of a variable once it is set. Why do you want to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 14:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597331#M172096</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-10-17T14:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: change the length of multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597381#M172113</link>
      <description>&lt;P&gt;I would say the real question is why are you treating 0/1 coded variables as character at all. A great many things can be done with 0/1 numeric values easily that cannot be done quite as simply with character values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sum of the variables gives a count of 1 values&lt;/P&gt;
&lt;P&gt;Mean of the variables give a percent of 1 values&lt;/P&gt;
&lt;P&gt;Range of the variables can tell if all the variables are the same&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lengths are set when created. You could use an ATTRIB, LENGTH or INFORMAT statement prior to the INPUT to read the variables as desired. For example, assuming that you want the X&amp;nbsp;variables to be length 1.&lt;/P&gt;
&lt;PRE&gt;data wide;
   length x1 - x2 $ 1;
   input enrolid x1$ x2 $ date1 date2 time;
datalines;1233   1 1 01/01/2012   . 111
4444  1 1  02/02/2012   .  33
666   0 1   .        02/03/2012  11
6666   0 1   03/03/2012 04/01/2012 11; 
run; &lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2019 15:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597381#M172113</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-17T15:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: change the length of multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597389#M172119</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 15:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597389#M172119</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2019-10-17T15:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: change the length of multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597393#M172123</link>
      <description>&lt;P&gt;Note an INFORMAT statement is for attaching informats to the variables, not defining their length.&amp;nbsp; If it is the first place where the variable is mentioned then it will have a side effect of forcing the compiler to guess what type/length to use for the variable.&amp;nbsp; The same way that the compiler will guess if some other statement, like INPUT or an assignment statement, is the first place the variable appears.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 15:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-the-length-of-multiple-variables/m-p/597393#M172123</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-17T15:26:11Z</dc:date>
    </item>
  </channel>
</rss>

