<?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: Array and keep all if condition met in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Array-and-keep-all-if-condition-met/m-p/824358#M325558</link>
    <description>&lt;P&gt;Here is basic logic for looping over an array or variables and checking if ANY of them meet some condition.&lt;/P&gt;
&lt;P&gt;First set the overall result to FALSE.&amp;nbsp; Then loop until you run out of elements or you find one that it TRUE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   array code [10] ;
   any_a = 0;
   do index=1 to dim(code) while (not any_a);
      any_a = code[index] =: 'A';
   end;
   if ANY_A then output;
run;
   &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Jul 2022 13:48:00 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-07-20T13:48:00Z</dc:date>
    <item>
      <title>Array and keep all if condition met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-and-keep-all-if-condition-met/m-p/824343#M325548</link>
      <description>I have ICD 10 codes from 1 to 10 listed. &lt;BR /&gt;I would like to combine all codes values if any listed ICD 10 codes start with A. How can I do that? Thank you.&lt;BR /&gt;&lt;BR /&gt;Example fake data:&lt;BR /&gt;&lt;BR /&gt;Code1 code2 …code10&lt;BR /&gt;H25 G45&lt;BR /&gt;J257 D467 A56&lt;BR /&gt;A46 A56&lt;BR /&gt;F35 D456 A456 Y366&lt;BR /&gt;&lt;BR /&gt;Wanted data would be keep all values when start with A. &lt;BR /&gt;</description>
      <pubDate>Wed, 20 Jul 2022 12:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-and-keep-all-if-condition-met/m-p/824343#M325548</guid>
      <dc:creator>Emma2021</dc:creator>
      <dc:date>2022-07-20T12:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Array and keep all if condition met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-and-keep-all-if-condition-met/m-p/824358#M325558</link>
      <description>&lt;P&gt;Here is basic logic for looping over an array or variables and checking if ANY of them meet some condition.&lt;/P&gt;
&lt;P&gt;First set the overall result to FALSE.&amp;nbsp; Then loop until you run out of elements or you find one that it TRUE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   array code [10] ;
   any_a = 0;
   do index=1 to dim(code) while (not any_a);
      any_a = code[index] =: 'A';
   end;
   if ANY_A then output;
run;
   &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2022 13:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-and-keep-all-if-condition-met/m-p/824358#M325558</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-20T13:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Array and keep all if condition met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-and-keep-all-if-condition-met/m-p/824360#M325560</link>
      <description>&lt;P&gt;You should explain what you mean by "combine". If you mean to place multiple values into one variable that is likely to become a variable that is extremely difficult to work with.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 14:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-and-keep-all-if-condition-met/m-p/824360#M325560</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-07-20T14:03:31Z</dc:date>
    </item>
  </channel>
</rss>

