<?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 with multiple possibilities for do loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Array-with-multiple-possibilities-for-do-loop/m-p/802338#M315852</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37814"&gt;@Walternate&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0vupy1vhs8gosn1tjd3zg8dtf76.htm" target="_blank" rel="noopener"&gt;CONTINUE statement&lt;/A&gt; to "skip" the values in TIMEPOINT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input timepoint $4.;
cards;
.
1
2
3
4
5
1, 2
2, 3
3, 4
4, 5
1, 3
;

data want;
set have;
do i=1 to 5;
  if findw(timepoint,put(i,1.)) then continue;
  /* more code to "check the consistency of values" */
  output; /* &amp;lt;-- just as an example */
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 15 Mar 2022 20:25:56 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2022-03-15T20:25:56Z</dc:date>
    <item>
      <title>Array with multiple possibilities for do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-with-multiple-possibilities-for-do-loop/m-p/802328#M315848</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to check the consistency of values of a variable across different timepoints.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Regular" records will have consistency checked for across all 5 timepoints. However, there are some special cases (based on the variable called timepoint) that should only look at CERTAIN timepoints rather than looping through all of them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Timepoint can represent a single timepoint or up to 2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Timepoint&lt;/P&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;P&gt;5&lt;/P&gt;
&lt;P&gt;1, 2&lt;/P&gt;
&lt;P&gt;2, 3&lt;/P&gt;
&lt;P&gt;3, 4&lt;/P&gt;
&lt;P&gt;4, 5&lt;/P&gt;
&lt;P&gt;1, 3&lt;/P&gt;
&lt;P&gt;etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially what I'd like to do is set up the do-loop so that the iteration is conditional and based on the value of timepoint, ie:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. If timepoint is missing (regular record) do i = 1 to 5&lt;/P&gt;
&lt;P&gt;2. If timepoint = 1, cycle through every timepoint EXCEPT timepoint 1 (so do i = 2 to 5).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is much appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 19:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-with-multiple-possibilities-for-do-loop/m-p/802328#M315848</guid>
      <dc:creator>Walternate</dc:creator>
      <dc:date>2022-03-15T19:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Array with multiple possibilities for do loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-with-multiple-possibilities-for-do-loop/m-p/802338#M315852</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37814"&gt;@Walternate&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0vupy1vhs8gosn1tjd3zg8dtf76.htm" target="_blank" rel="noopener"&gt;CONTINUE statement&lt;/A&gt; to "skip" the values in TIMEPOINT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input timepoint $4.;
cards;
.
1
2
3
4
5
1, 2
2, 3
3, 4
4, 5
1, 3
;

data want;
set have;
do i=1 to 5;
  if findw(timepoint,put(i,1.)) then continue;
  /* more code to "check the consistency of values" */
  output; /* &amp;lt;-- just as an example */
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Mar 2022 20:25:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-with-multiple-possibilities-for-do-loop/m-p/802338#M315852</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-03-15T20:25:56Z</dc:date>
    </item>
  </channel>
</rss>

