<?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: How to skip every third number in DO iterative loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-skip-every-third-number-in-DO-iterative-loop/m-p/907225#M358146</link>
    <description>&lt;P&gt;Did you mean something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 week=0;
 day=1;
 do until(week&amp;gt;10);
   do inc=1 to 3;
     week+1;
     day+1;
     llc=day+1+inc;
     ulc=day+4+inc;
     if inc&amp;lt;3 then output;
     else week+-1;
   end;
 end;
 drop inc;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    week    day    llc    ulc

  1      1       2      4      7
  2      2       3      6      9
  3      3       5      7     10
  4      4       6      9     12
  5      5       8     10     13
  6      6       9     12     15
  7      7      11     13     16
  8      8      12     15     18
  9      9      14     16     19
 10     10      15     18     21
 11     11      17     19     22
 12     12      18     21     24
&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Dec 2023 04:41:19 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-12-11T04:41:19Z</dc:date>
    <item>
      <title>How to skip every third number in DO iterative loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-skip-every-third-number-in-DO-iterative-loop/m-p/907221#M358145</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;data want;
do week=1 to 100;
day=week+1;
llc=day+;
ulc=day+;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;I need help in DO iterative code. I need to skip every third number and create two variables for each row by adding different numbers.&lt;/P&gt;
&lt;P&gt;eg; for&amp;nbsp; 1,2,3&amp;nbsp; combination I need to skip 3 and&amp;nbsp; create llc and ulc variables for 1,2.&lt;/P&gt;
&lt;P&gt;For row 1, i need to calculate&amp;nbsp; llc=day+2 and ulc=day+5.&lt;/P&gt;
&lt;P&gt;For row 2, i need to calculate llc=day+3 and ulc=day+6&lt;/P&gt;
&lt;P&gt;I need to repeat above for all three set combinations.&amp;nbsp; Please suggest. Thank you&lt;/P&gt;
&lt;P&gt;output needed&lt;/P&gt;
&lt;P&gt;week&amp;nbsp; day&amp;nbsp; llc&amp;nbsp; ulc&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp;7&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&amp;nbsp; &amp;nbsp; &amp;nbsp; 9&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;/P&gt;
&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 03:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-skip-every-third-number-in-DO-iterative-loop/m-p/907221#M358145</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2023-12-11T03:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip every third number in DO iterative loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-skip-every-third-number-in-DO-iterative-loop/m-p/907225#M358146</link>
      <description>&lt;P&gt;Did you mean something like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 week=0;
 day=1;
 do until(week&amp;gt;10);
   do inc=1 to 3;
     week+1;
     day+1;
     llc=day+1+inc;
     ulc=day+4+inc;
     if inc&amp;lt;3 then output;
     else week+-1;
   end;
 end;
 drop inc;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    week    day    llc    ulc

  1      1       2      4      7
  2      2       3      6      9
  3      3       5      7     10
  4      4       6      9     12
  5      5       8     10     13
  6      6       9     12     15
  7      7      11     13     16
  8      8      12     15     18
  9      9      14     16     19
 10     10      15     18     21
 11     11      17     19     22
 12     12      18     21     24
&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Dec 2023 04:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-skip-every-third-number-in-DO-iterative-loop/m-p/907225#M358146</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-12-11T04:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip every third number in DO iterative loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-skip-every-third-number-in-DO-iterative-loop/m-p/907226#M358147</link>
      <description>&lt;P&gt;Here one option&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  do week=1 to 100;
    rem=mod(week,3);
    if rem = 0 then continue;
    day=week+1;
    llc=day+1+rem;
    ulc=day+4+rem;
    output;
  end;
  drop rem;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 05:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-skip-every-third-number-in-DO-iterative-loop/m-p/907226#M358147</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-12-11T05:12:00Z</dc:date>
    </item>
  </channel>
</rss>

