<?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 Variable Length is not changing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840674#M332401</link>
    <description>&lt;P&gt;Hi, I am doing Programming 2 lesson 5 on Concatenating tables.&lt;/P&gt;
&lt;P&gt;In the video, it says that we can change the length of an attribute by using LENGTH statement prior to the SET statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_0-1666728953820.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76605i220E385910BF80C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_0-1666728953820.png" alt="Nietzsche_0-1666728953820.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;However after running the following code, the length of Name variable is still 8, not 9.&lt;/P&gt;
&lt;PRE&gt;data class_current;
	length Name $9;
    set sashelp.class pg2.class_new2 (rename=(Student=Name));
run;

proc contents data=sashelp.class;
run;

proc contents data=pg2.class_new2;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_2-1666729305143.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76607i2F8F473588A0A133/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_2-1666729305143.png" alt="Nietzsche_2-1666729305143.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;did I misunderstand the instructor or did I do something wrong in the code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 20:22:24 GMT</pubDate>
    <dc:creator>Nietzsche</dc:creator>
    <dc:date>2022-10-25T20:22:24Z</dc:date>
    <item>
      <title>Variable Length is not changing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840674#M332401</link>
      <description>&lt;P&gt;Hi, I am doing Programming 2 lesson 5 on Concatenating tables.&lt;/P&gt;
&lt;P&gt;In the video, it says that we can change the length of an attribute by using LENGTH statement prior to the SET statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_0-1666728953820.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76605i220E385910BF80C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_0-1666728953820.png" alt="Nietzsche_0-1666728953820.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;However after running the following code, the length of Name variable is still 8, not 9.&lt;/P&gt;
&lt;PRE&gt;data class_current;
	length Name $9;
    set sashelp.class pg2.class_new2 (rename=(Student=Name));
run;

proc contents data=sashelp.class;
run;

proc contents data=pg2.class_new2;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_2-1666729305143.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76607i2F8F473588A0A133/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_2-1666729305143.png" alt="Nietzsche_2-1666729305143.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;did I misunderstand the instructor or did I do something wrong in the code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 20:22:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840674#M332401</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-10-25T20:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Length is not changing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840676#M332402</link>
      <description>&lt;P&gt;You are changing the length of NAME in the dataset CLASS_CURRENT not SASHELP.CLASS.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 20:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840676#M332402</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-10-25T20:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Length is not changing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840677#M332403</link>
      <description>&lt;P&gt;thanks man.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 20:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840677#M332403</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-10-25T20:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Length is not changing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840679#M332405</link>
      <description>&lt;P&gt;another question I have is&lt;/P&gt;
&lt;P&gt;How come there is no period after the 9 in the LENGTH statement? Since we are specifying a formatting attribute, should it have a period or period is only necessary in the FORMAT statement?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 20:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840679#M332405</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-10-25T20:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Length is not changing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840684#M332406</link>
      <description>&lt;P&gt;You don't use periods in LENGTH statements as you are only defining how many bytes a variable is stored in. A period is used in FORMAT and INFORMAT definitions to specify the boundary between the number of digits or characters to be displayed / inputted and the number of decimals for a numeric format.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 20:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840684#M332406</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-10-25T20:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Length is not changing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840726#M332418</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431484"&gt;@Nietzsche&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;another question I have is&lt;/P&gt;
&lt;P&gt;How come there is no period after the 9 in the LENGTH statement? Since we are specifying a formatting attribute, should it have a period or period is only necessary in the FORMAT statement?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The LENGTH statement is NOT attaching a FORMAT (nor an INFORMAT) to the variable.&amp;nbsp; It is defining how many bytes the dataset should use to store the value.&amp;nbsp; &amp;nbsp;The LENGTH statement only accepts integer values so there is no need to include a decimal point in the value.&amp;nbsp; (Note it will ignore a period if you add one, but don't add one.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The period in a FORMAT or an INFORMAT specification serves two purposes.&amp;nbsp; It separates the width of the format (or informat) from the optional number of decimal places.&amp;nbsp; &amp;nbsp;It also makes it so that SAS knows that you mean a FORMAT or INFORMAT and not a variable name.&amp;nbsp; Otherwise how could SAS parse the FORMAT statement?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 01:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Length-is-not-changing/m-p/840726#M332418</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-26T01:05:36Z</dc:date>
    </item>
  </channel>
</rss>

