<?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: Doubt regarding compile/execution time features... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Doubt-regarding-compile-execution-time-features/m-p/70685#M15283</link>
    <description>In other words, length() assesses a string (after trimming it), not a variable characteristics.</description>
    <pubDate>Thu, 25 Mar 2010 02:37:46 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2010-03-25T02:37:46Z</dc:date>
    <item>
      <title>Doubt regarding compile/execution time features...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doubt-regarding-compile-execution-time-features/m-p/70683#M15281</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have a doubt regarding the length of variables during compilation/execution time. &lt;BR /&gt;
&lt;BR /&gt;
The code,&lt;BR /&gt;
&lt;BR /&gt;
1  data one;&lt;BR /&gt;
2  name='AAA';&lt;BR /&gt;
3  result=repeat(name,10);&lt;BR /&gt;
4  length_var=length(result);&lt;BR /&gt;
5  run;&lt;BR /&gt;
6&lt;BR /&gt;
7  proc contents data=one;&lt;BR /&gt;
8  run;&lt;BR /&gt;
&lt;BR /&gt;
Here, the output of the proc contents shows the length of the variable "result" is 200. I remember the length of the resultant variable when using "repeat" function will be 200. But, when i open the dataset "one" to see the value of "length_var" which should have the length of the variable "result", is only 33. What may the reason behind this?&lt;BR /&gt;
&lt;BR /&gt;
The attribute length of the variable "result" is determined at compile time and the value of the variable "length_var" which is the output of the length function is determined only at execution time. Is this the reason?&lt;BR /&gt;
&lt;BR /&gt;
Won't the SAS consider the attributes of the variable "result" when scanning the the line 4 during compile time?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 24 Mar 2010 15:16:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doubt-regarding-compile-execution-time-features/m-p/70683#M15281</guid>
      <dc:creator>msg</dc:creator>
      <dc:date>2010-03-24T15:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt regarding compile/execution time features...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doubt-regarding-compile-execution-time-features/m-p/70684#M15282</link>
      <description>The LENGTH function resolves with each variable interrogation (at execution time -- and on each DATA step iteration).&lt;BR /&gt;
&lt;BR /&gt;
So, even within a single DATA step pass, you could alter the SAS CHARACTER variable contents (shorten or lengthen) and the LENGTH will report a result, based on the current contents (without considering any blank-padding) -- it does not reflect the SAS system dataset declared (or implied) variable length -- which is actually the maximum length possible, when considering truncation.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Recommended Google advanced search argument, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
length function character variable site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Also, suggested SAS Base System DOC reading:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304318.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304318.htm&lt;/A&gt;</description>
      <pubDate>Wed, 24 Mar 2010 15:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doubt-regarding-compile-execution-time-features/m-p/70684#M15282</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-24T15:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt regarding compile/execution time features...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doubt-regarding-compile-execution-time-features/m-p/70685#M15283</link>
      <description>In other words, length() assesses a string (after trimming it), not a variable characteristics.</description>
      <pubDate>Thu, 25 Mar 2010 02:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doubt-regarding-compile-execution-time-features/m-p/70685#M15283</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2010-03-25T02:37:46Z</dc:date>
    </item>
  </channel>
</rss>

