<?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: susbstrn statement with different lengths variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/susbstrn-statement-with-different-lengths-variables/m-p/460314#M116992</link>
    <description>&lt;P&gt;I'm not sure you have the spelling right, but here's a variation that works for character strings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if x{i} in : ('210','220','2299') then do;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 06 May 2018 19:16:30 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-05-06T19:16:30Z</dc:date>
    <item>
      <title>susbstrn statement with different lengths variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/susbstrn-statement-with-different-lengths-variables/m-p/460309#M116989</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have the following statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data a (drop=i); set b; array x{*} dx:; r=1=0;&lt;/P&gt;&lt;P&gt;do i=1 to dim(x); if susbtrn(x{i},1,3) in ('210','220') then do; r=1;&lt;/P&gt;&lt;P&gt;leave;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my question if I want to include another entry with a length of 4 meaning if susbtrn= '210', '220', '2320', how can I adjust the above statement to account for different the lengths?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 18:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/susbstrn-statement-with-different-lengths-variables/m-p/460309#M116989</guid>
      <dc:creator>lillymaginta</dc:creator>
      <dc:date>2018-05-06T18:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: susbstrn statement with different lengths variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/susbstrn-statement-with-different-lengths-variables/m-p/460312#M116991</link>
      <description>&lt;P&gt;data a (drop=i); set b; array x{*} dx:; r=1=0;&lt;/P&gt;&lt;P&gt;do i=1 to dim(x);&lt;BR /&gt;if susbtrn(x{i},1,3) in ('210','220')&lt;BR /&gt;or susbtrn(x{i},1,4) in ( '2320')&lt;BR /&gt;then do; r=1;&lt;/P&gt;&lt;P&gt;leave;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 19:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/susbstrn-statement-with-different-lengths-variables/m-p/460312#M116991</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-06T19:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: susbstrn statement with different lengths variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/susbstrn-statement-with-different-lengths-variables/m-p/460314#M116992</link>
      <description>&lt;P&gt;I'm not sure you have the spelling right, but here's a variation that works for character strings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if x{i} in : ('210','220','2299') then do;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 19:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/susbstrn-statement-with-different-lengths-variables/m-p/460314#M116992</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-05-06T19:16:30Z</dc:date>
    </item>
  </channel>
</rss>

