<?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 CODITION TO LIMIT THE LENGHT OF THE CHAR IN SAS DATA SET. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722616#M224090</link>
    <description>&lt;P&gt;First thing I suggest is running proc contents on your data set. If the defined length of a variable is 100 or less then you should not expect to find any values with a length greater than 100 as that is the limit on the variable for that data set. No rows selected means none of the variables meet your condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect this line has a typo somewhere : "i wrote another program, that find out if the program encounters more than 100 variables in it." I suspect that you meant characters. Without seeing the code and exact error message then I can't really address what may have happened.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Mar 2021 16:50:36 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-03-01T16:50:36Z</dc:date>
    <item>
      <title>WHERE CODITION TO LIMIT THE LENGHT OF THE CHAR IN SAS DATA SET.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722600#M224083</link>
      <description>&lt;P&gt;Good evening everyone.&lt;/P&gt;&lt;P&gt;I have a csv files which consists of data and lenght to the colume was given 100. and i wrote another program, that find out if the program encounters more than 100 variables in it. It has to give an error message to the log folder(which is my pc log folder).&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when i execute the below code I see in the log(SAS ENTERPRISE LOG)&lt;/P&gt;&lt;P&gt;NOTE: "No rows were selected".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select distinct DB, DD&lt;BR /&gt;into: cod_es separated by ";" , : des_es separated by ";"&lt;BR /&gt;from work.Data&lt;BR /&gt;WHERE length(DD) = 0 OR length(DD) &amp;gt; 100 ;&amp;nbsp; /*Where length(DD) = 0 and length(DD) &amp;gt; 100*/&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Also tried with the "and"&amp;nbsp; in where)&lt;/P&gt;&lt;P&gt;Please help me with this. Thank you.&lt;/P&gt;&lt;P&gt;Any suggestions would be appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 15:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722600#M224083</guid>
      <dc:creator>shailaja3</dc:creator>
      <dc:date>2021-03-01T15:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE CODITION TO LIMIT THE LENGHT OF THE CHAR IN SAS DATA SET.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722616#M224090</link>
      <description>&lt;P&gt;First thing I suggest is running proc contents on your data set. If the defined length of a variable is 100 or less then you should not expect to find any values with a length greater than 100 as that is the limit on the variable for that data set. No rows selected means none of the variables meet your condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect this line has a typo somewhere : "i wrote another program, that find out if the program encounters more than 100 variables in it." I suspect that you meant characters. Without seeing the code and exact error message then I can't really address what may have happened.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 16:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722616#M224090</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-01T16:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE CODITION TO LIMIT THE LENGHT OF THE CHAR IN SAS DATA SET.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722618#M224092</link>
      <description>&lt;P&gt;Please clarify what you have done.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code is testing the length of the variable DD in the dataset WORK.DATA (note: this is potentially confusing name a dataset).&amp;nbsp; If the variable DD is defined with a length of $100 it can never have a value that is larger than 100.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you read the CSV file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to test the length of the strings in the column of the CSV file then you will need to read the data from the CSV into a variable with a length that is longer then $100.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 16:53:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722618#M224092</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-01T16:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE CODITION TO LIMIT THE LENGHT OF THE CHAR IN SAS DATA SET.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722661#M224105</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/360246"&gt;@shailaja3&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to the other comments:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Regardless of the defined length and content of character variable &lt;FONT face="courier new,courier"&gt;DD&lt;/FONT&gt;, the condition &lt;FONT face="courier new,courier"&gt;length(DD)=0&lt;/FONT&gt; will always be FALSE. You can use the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0z9e0q6e8snidn1t9m5pysmkl79.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;LENGTHN&lt;/A&gt; (or &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p06ybg84o0asa4n17l9ieauk58hb.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;MISSING&lt;/A&gt; or &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p1tth4ltf640din1ey86ubo2lky2.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;CMISS&lt;/A&gt;) function or an explicit comparison (&lt;FONT face="courier new,courier"&gt;DD=' '&lt;/FONT&gt;) to check if DD is empty.&lt;/LI&gt;
&lt;/UL&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/360246"&gt;@shailaja3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;(...)&lt;/P&gt;
&lt;P&gt;WHERE length(DD) = 0 OR length(DD) &amp;gt; 100 ;&amp;nbsp; /*Where length(DD) = 0 and length(DD) &amp;gt; 100*/&lt;/P&gt;
&lt;P&gt;(...)&lt;/P&gt;
&lt;P&gt;(Also tried with the "and"&amp;nbsp; in where)&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;Logical conditions should not be subject to trial and error. While in terms of human language you may be interested in observations where DD is empty &lt;EM&gt;and&lt;/EM&gt; in (other) observations where DD exceeds length 100, the WHERE condition using the Boolean operator AND&amp;nbsp;would be a contradiction in terms and hence &lt;EM&gt;never&lt;/EM&gt; be met: A numeric value such as &lt;FONT face="courier new,courier"&gt;length(DD)&lt;/FONT&gt; &lt;EM&gt;cannot&lt;/EM&gt; be greater than 100 &lt;EM&gt;and&lt;/EM&gt; at the same time (i.e., in the same observation) equal to 0.&lt;/LI&gt;
&lt;LI&gt;If variable DD has defined length 100 and the question is whether truncation has occurred, I would first look out for telltale values of DD with length 99 or 100. But without the CSV file nobody could give a definitive answer.&lt;/LI&gt;
&lt;LI&gt;Without a good reason I would not use the semicolon as a separator in macro variables because I like to use the %PUT statement (e.g.,&amp;nbsp;&lt;FONT face="courier new,courier"&gt;%put &amp;amp;=des_es;&lt;/FONT&gt;) without macro quoting.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 19:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-CODITION-TO-LIMIT-THE-LENGHT-OF-THE-CHAR-IN-SAS-DATA-SET/m-p/722661#M224105</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-03-01T19:00:30Z</dc:date>
    </item>
  </channel>
</rss>

