<?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: Is one charater 1 byte? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Is-one-charater-1-byte/m-p/607416#M17534</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/288742"&gt;@zimu94681&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just want to confirm that in length statement, when you define the length as "$10"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it means that this cell can only contain a word/phrase less than 10 characters?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is one character use 1 byte?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks! &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The length is the number of BYTES that are stored in the dataset.&amp;nbsp; For character variables that is also the number of bytes they can contain in the processing of the data step.&amp;nbsp; For numeric variables they always need 8 bytes but the LENGTH can be used to control how many bytes are written to the dataset. On Windows/Linux this can be between 3 and 8 bytes. Z/OS you can also store numbers in just 2 bytes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The number of characters that will fit in a fixed number of bytes depends on what encoding your SAS session is using. If you are using a single byte encoding, like WLATIN1, then each character takes one byte.&amp;nbsp; If you are using double byte characters (common with Japanese or Chinese) then each character needs two bytes.&amp;nbsp; &amp;nbsp;If you are using UTF8 encoding (also called unicode support) then a character can use between 1 and 3 bytes, depending on the character.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2019 16:33:06 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-11-26T16:33:06Z</dc:date>
    <item>
      <title>Is one charater 1 byte?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-one-charater-1-byte/m-p/607383#M17531</link>
      <description>&lt;P&gt;I just want to confirm that in length statement, when you define the length as "$10"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it means that this cell can only contain a word/phrase less than 10 characters?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is one character use 1 byte?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks! &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 15:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-one-charater-1-byte/m-p/607383#M17531</guid>
      <dc:creator>zimu94681</dc:creator>
      <dc:date>2019-11-26T15:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is one charater 1 byte?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-one-charater-1-byte/m-p/607402#M17532</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;length&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="xisDoc-paragraph"&gt;&lt;STRONG&gt;refers to the number of bytes used to store each of the variable's values&lt;/STRONG&gt; in a&lt;SPAN class="ng-scope" data-gloss-modified="" data-gloss-item="1"&gt;&lt;A class="glossLink ng-scope" href="https://documentation.sas.com/" target="_blank"&gt;&lt;SPAN class="xisDoc-glossTerm ng-scope" data-gloss-term="1"&gt;SAS data set&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;. You can use a&lt;A class="ng-scope" tabindex="0" title="" href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p1hgqgmxm3dpqcn1d4w5za5qbz0d.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" data-docset-id="lestmtsref" data-docset-version="9.4" data-original-href="p1hgqgmxm3dpqcn1d4w5za5qbz0d.htm"&gt;LENGTH statement&lt;/A&gt;to set the length of both numeric and character variables. Variable lengths that are specified in a LENGTH statement affect the length of numeric variables only in the output data set. During processing, all numeric variables have a length of 8. Lengths of character variables that are specified in a LENGTH statement affect both the length during processing and the length in the output data set.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P class="xisDoc-paragraph"&gt;Source:&lt;/P&gt;
&lt;P class="xisDoc-paragraph"&gt;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=n08fs0rt7fikeln1uh0t8v5pt25d.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=n08fs0rt7fikeln1uh0t8v5pt25d.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P class="xisDoc-paragraph"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paragraph"&gt;Yes, a length of 10 means you can store character values that are a length of 10 or less only and that's 10 bytes.&lt;/P&gt;
&lt;P class="xisDoc-paragraph"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/288742"&gt;@zimu94681&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just want to confirm that in length statement, when you define the length as "$10"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it means that this cell can only contain a word/phrase less than 10 characters?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is one character use 1 byte?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks! &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class="xisDoc-paragraph"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paragraph"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 16:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-one-charater-1-byte/m-p/607402#M17532</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-26T16:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is one charater 1 byte?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Is-one-charater-1-byte/m-p/607416#M17534</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/288742"&gt;@zimu94681&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just want to confirm that in length statement, when you define the length as "$10"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it means that this cell can only contain a word/phrase less than 10 characters?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is one character use 1 byte?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks! &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The length is the number of BYTES that are stored in the dataset.&amp;nbsp; For character variables that is also the number of bytes they can contain in the processing of the data step.&amp;nbsp; For numeric variables they always need 8 bytes but the LENGTH can be used to control how many bytes are written to the dataset. On Windows/Linux this can be between 3 and 8 bytes. Z/OS you can also store numbers in just 2 bytes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The number of characters that will fit in a fixed number of bytes depends on what encoding your SAS session is using. If you are using a single byte encoding, like WLATIN1, then each character takes one byte.&amp;nbsp; If you are using double byte characters (common with Japanese or Chinese) then each character needs two bytes.&amp;nbsp; &amp;nbsp;If you are using UTF8 encoding (also called unicode support) then a character can use between 1 and 3 bytes, depending on the character.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 16:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Is-one-charater-1-byte/m-p/607416#M17534</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-26T16:33:06Z</dc:date>
    </item>
  </channel>
</rss>

