<?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: Where Character Length = X in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444945#M28774</link>
    <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt;  a&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;date_created &lt;SPAN class="token operator"&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;02&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;20&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2018&lt;/SPAN&gt;
and &lt;SPAN class="token function"&gt;length&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;account_number) &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;10&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 12 Mar 2018 21:33:39 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-03-12T21:33:39Z</dc:date>
    <item>
      <title>Where Character Length = X</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444944#M28773</link>
      <description>&lt;P&gt;Quick question all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need Proc Sql syntax for a where statement bring back only records with a string length of 10.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried ths and it didn't work:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where  a.date_created &amp;gt;=02/20/2018
and length(account_number = 10) &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks for any suggestions!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 21:26:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444944#M28773</guid>
      <dc:creator>Dogo23</dc:creator>
      <dc:date>2018-03-12T21:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Where Character Length = X</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444945#M28774</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;where&lt;/SPAN&gt;  a&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;date_created &lt;SPAN class="token operator"&gt;&amp;gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;02&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;20&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2018&lt;/SPAN&gt;
and &lt;SPAN class="token function"&gt;length&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;account_number) &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;10&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Mar 2018 21:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444945#M28774</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-03-12T21:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Where Character Length = X</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444947#M28775</link>
      <description>&lt;P&gt;Strange! Your's matches mine so maybe there was a minor difference between what I posted and what I actually ran. This works. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 21:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444947#M28775</guid>
      <dc:creator>Dogo23</dc:creator>
      <dc:date>2018-03-12T21:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Where Character Length = X</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444948#M28776</link>
      <description>&lt;P&gt;In addition to the suggestion from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;that moves one of the closing parentheses:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A WHERE statement requires a semicolon, and&lt;/LI&gt;
&lt;LI&gt;02/20/2018 is the wrong way to refer to a date.&amp;nbsp; This actually means 2 divided by 20, divided by 2018.&amp;nbsp; Instead of 02/20/2018:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;'20Feb2018'd&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 21:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444948#M28776</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-12T21:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Where Character Length = X</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444950#M28777</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174883"&gt;@Dogo23&lt;/a&gt;&amp;nbsp;to help you clarify a bit more, see the below demo&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data h;
input var $10.;
datalines;
9999999999
99999
9999999999
8888888888
777777
888
;

data w;
set h;
length=length(var);
length2=length(var)=10;/*your were trying to compute the length of binary result which will always result in 1*/
if length(var=10) then flag=1;/*your were trying to compute the length of binary result*/
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Your check was a binary check nested before the length function computes it's work. The nested binary will result in 1 or 0 for values that is 10 and "Not aka 0" for otherwise. The commented section should help i think. Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 21:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Where-Character-Length-X/m-p/444950#M28777</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-03-12T21:44:19Z</dc:date>
    </item>
  </channel>
</rss>

