<?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 the length of character variable in the base dataset before appending multiple datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863306#M341030</link>
    <description>&lt;P&gt;Do not confuse the storage LENGTH of a variable with the &lt;EM&gt;width&lt;/EM&gt; of a FORMAT assigned to it. If the variable also has a format of $7. assigned to it, you won't see more than 7 characters.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Mar 2023 21:32:07 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-03-09T21:32:07Z</dc:date>
    <item>
      <title>Changing the length of character variable in the base dataset before appending multiple datasets.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863296#M341026</link>
      <description>&lt;P&gt;I ran this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; dir.ENGBase;&lt;/P&gt;&lt;P&gt;length s2_disability_0_5_other $38;&lt;/P&gt;&lt;P&gt;set dir.E1;&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;Goal is to change the length of s2_disability_0_5_other from a length of 7&amp;nbsp; in the set dir.E1 to 38 characters in the set dir.ENGBase.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code above, the length doesn’t change in the new dataset ENGBase. It still shows as length 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me understand what I’m doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a long list of char variables in E1 whose length I need to increase in the output ENGBase to accommodate a future append of multiple datasets max lengths. I already determined what the max length needs to be in the first dataset so that no truncation happens.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on how to get the lengths to increase in the base dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it with and without the "." after the length number 38.&amp;nbsp; Neither worked.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 21:11:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863296#M341026</guid>
      <dc:creator>sfarash</dc:creator>
      <dc:date>2023-03-09T21:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the length of character variable in the base dataset before appending multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863302#M341027</link>
      <description>&lt;P&gt;Your code looks good to me.&amp;nbsp; Double check the log, do you get any errors/warnings/bad notes?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I ran a modified version of your code and it worked fine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data E1 ;
  length s2_disability_0_5_other $7;
  s2_disability_0_5_other="Q" ;
run ;

data ENGBase;
  length s2_disability_0_5_other $38;
  set E1;
run;

proc contents data=E1 ;
run ;

proc contents data=ENGBase ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 21:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863302#M341027</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-03-09T21:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the length of character variable in the base dataset before appending multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863304#M341028</link>
      <description>&lt;P&gt;Did the log show anything entertaining? It might help to show us the Log from when you ran the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is the variable s2_disability_0_5_other in column 1? (you can check with contents or opening the data set) If not, then you are likely dealing with a failure to replace an existing data set for some reason, or something else overwriting the set.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 21:19:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863304#M341028</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-09T21:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the length of character variable in the base dataset before appending multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863306#M341030</link>
      <description>&lt;P&gt;Do not confuse the storage LENGTH of a variable with the &lt;EM&gt;width&lt;/EM&gt; of a FORMAT assigned to it. If the variable also has a format of $7. assigned to it, you won't see more than 7 characters.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 21:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863306#M341030</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-09T21:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the length of character variable in the base dataset before appending multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863308#M341032</link>
      <description>&lt;P&gt;Please show us PROC CONTENTS output for variable s2_disability_0_5_other in data set dir.ENGBase. And as requested by others, also show us the full log for this DATA step.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 21:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Changing-the-length-of-character-variable-in-the-base-dataset/m-p/863308#M341032</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-09T21:41:08Z</dc:date>
    </item>
  </channel>
</rss>

