<?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 Length of Character Variable in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684298#M9386</link>
    <description>&lt;P&gt;You can change length of a variable, but you take a risk of assigning a too short and value might be truncated. The code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;  
     length SSN &amp;lt;new length&amp;gt;;
 set have;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Sep 2020 15:57:43 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2020-09-16T15:57:43Z</dc:date>
    <item>
      <title>Changing Length of Character Variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684295#M9385</link>
      <description>&lt;P&gt;Changing the l&lt;SPAN style="font-family: inherit;"&gt;ength of a Character Variable&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;***************************************************************************************&lt;/P&gt;&lt;P&gt;Hello SAS Communities,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recently use&lt;SPAN style="font-family: inherit;"&gt;d proc import to import data from a .xls file. One of the variables within the data set is a character variable and the desired length is 11 variables long, however, after importing the data into my program the length of this variable is now 12.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the SAS Table Properties that show the variable length for the variable SSN and the proc import statement that I used:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DATAFILE = "&amp;amp;CourseRoot/Study/Data/Source/DATA.xls"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OUT = WORK.DATA&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DBMS = XLS&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; REPLACE ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; SHEET = "Sheet1";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to change the variable length for SSN from 12 to 11?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;De'Janae' Guillory-Williams&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684295#M9385</guid>
      <dc:creator>DeJanae07</dc:creator>
      <dc:date>2020-12-10T15:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Length of Character Variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684298#M9386</link>
      <description>&lt;P&gt;You can change length of a variable, but you take a risk of assigning a too short and value might be truncated. The code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;  
     length SSN &amp;lt;new length&amp;gt;;
 set have;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Sep 2020 15:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684298#M9386</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-09-16T15:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Length of Character Variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684300#M9387</link>
      <description>Longer is better than shorter, you can just re-set it with a length statement. Make sure that it follows right after the data statement.</description>
      <pubDate>Wed, 16 Sep 2020 16:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684300#M9387</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2020-09-16T16:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Length of Character Variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684578#M9388</link>
      <description>data have;&lt;BR /&gt; set sashelp.class;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;alter table have&lt;BR /&gt;modify name char(20);&lt;BR /&gt;quit;</description>
      <pubDate>Thu, 17 Sep 2020 12:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Changing-Length-of-Character-Variable/m-p/684578#M9388</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-09-17T12:54:50Z</dc:date>
    </item>
  </channel>
</rss>

