<?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: Length over 50 characters? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Length-over-50-characters/m-p/792043#M253778</link>
    <description>&lt;P&gt;If you've decided on 10 rows.&lt;/P&gt;
&lt;P&gt;it's a simple code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table want as 
  select * from sample
  where length(col1)&amp;gt;50 or
        length(col2)&amp;gt;50 or
        length(col3)&amp;gt;50 or
        length(col4)&amp;gt;50 or
        length(col5)&amp;gt;50 or
        length(col6)&amp;gt;50 or
        length(col7)&amp;gt;50 or
        length(col8)&amp;gt;50 or
        length(col9)&amp;gt;50 or
        length(col10)&amp;gt;50
  ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the number of columns fluctuates, you can use the max and length functions to find the maximum number of characters and check if it exceeds 50.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set sample;
  array c{*} col1-col10;
  do i=1 to dim(c);
    maxl=max(maxl,length(c{i}));
  end;
  if maxl&amp;gt;50;
  drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Jan 2022 01:23:38 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2022-01-25T01:23:38Z</dc:date>
    <item>
      <title>Length over 50 characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-over-50-characters/m-p/792034#M253772</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;
&lt;P&gt;I have a sample dataset with 10 columns, all of them are text characters, and each column has over 400 rows.&amp;nbsp; &amp;nbsp;I would like to search any rows that are over 50 characters in those 10 columns.&amp;nbsp; &amp;nbsp;Please advise how to approach it.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 00:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-over-50-characters/m-p/792034#M253772</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2022-01-25T00:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Length over 50 characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-over-50-characters/m-p/792038#M253775</link>
      <description>&lt;P&gt;And do what with them? What do you want as output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello experts,&lt;/P&gt;
&lt;P&gt;I have a sample dataset with 10 columns, all of them are text characters, and each column has over 400 rows.&amp;nbsp; &amp;nbsp;I would like to search any rows that are over 50 characters in those 10 columns.&amp;nbsp; &amp;nbsp;Please advise how to approach it.&amp;nbsp; Thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

array _chars(10) list of variables here;
array _l(10) len1-len10;

do i=1 to 10;
if length(_chars(i)) &amp;gt;= 50 then _l(i) =1;
else _l(i)=0;
end;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jan 2022 01:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-over-50-characters/m-p/792038#M253775</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-25T01:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Length over 50 characters?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-over-50-characters/m-p/792043#M253778</link>
      <description>&lt;P&gt;If you've decided on 10 rows.&lt;/P&gt;
&lt;P&gt;it's a simple code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table want as 
  select * from sample
  where length(col1)&amp;gt;50 or
        length(col2)&amp;gt;50 or
        length(col3)&amp;gt;50 or
        length(col4)&amp;gt;50 or
        length(col5)&amp;gt;50 or
        length(col6)&amp;gt;50 or
        length(col7)&amp;gt;50 or
        length(col8)&amp;gt;50 or
        length(col9)&amp;gt;50 or
        length(col10)&amp;gt;50
  ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the number of columns fluctuates, you can use the max and length functions to find the maximum number of characters and check if it exceeds 50.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set sample;
  array c{*} col1-col10;
  do i=1 to dim(c);
    maxl=max(maxl,length(c{i}));
  end;
  if maxl&amp;gt;50;
  drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jan 2022 01:23:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-over-50-characters/m-p/792043#M253778</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-01-25T01:23:38Z</dc:date>
    </item>
  </channel>
</rss>

