<?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 create table shell using do loops in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-table-shell-using-do-loops/m-p/655635#M196703</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp; Please try if you like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data shell;
	do ord1= 1 to 5;
	  _n_=0;
    	do ord2= 2 ,5 ,6 ,7 ,8 ,9 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19;
			_n_+1;

			do ord3= 0 to 6;
				if _n_&amp;gt;1 and ord3=0 then
					continue;

				/*summary statistics*/
				output;
			end;
		end;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Jun 2020 21:12:13 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-06-09T21:12:13Z</dc:date>
    <item>
      <title>How to create table shell using do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-table-shell-using-do-loops/m-p/655631#M196701</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using do loops to create table shells but it is create extra rows I do not need.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data shell;
	 do ord1= 1 to 5;  												/*params*/
		do ord2= 2 ,5 ,6 ,7 ,8 ,9 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19;  /*avisitn*/
			do ord3= 0 to 6;										/*summary statistics*/
			output;
			end;
		end;
	 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dupes.PNG" style="width: 282px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/41597i628D7D660774C091/image-size/large?v=v2&amp;amp;px=999" role="button" title="dupes.PNG" alt="dupes.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only need to keep one "ord3=0"&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 20:51:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-table-shell-using-do-loops/m-p/655631#M196701</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-06-09T20:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table shell using do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-table-shell-using-do-loops/m-p/655634#M196702</link>
      <description>&lt;P&gt;Could you clarify--do you want ord3 = 0 only &lt;EM&gt;once in all&lt;/EM&gt;, or only once &lt;EM&gt;for each loop&lt;/EM&gt; of ord1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are solutions for each (respectively):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data shell;
	 do ord1= 1 to 5;  												
		do ord2= 2 ,5 ,6 ,7 ,8 ,9 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19;
            if(ord1 = 1 and ord2 = 2) then do;
                do ord3= 0 to 6;
			    output;
			    end;
            end;
            else do;
                do ord3= 1 to 6;
			    output;
			    end;
            end;
		end;
	 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data shell;
	 do ord1= 1 to 5;  												
		do ord2= 2 ,5 ,6 ,7 ,8 ,9 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19;
            if(ord2 = 2) then do;
                do ord3= 0 to 6;
			    output;
			    end;
            end;
            else do;
                do ord3= 1 to 6;
			    output;
			    end;
            end;
		end;
	 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jun 2020 21:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-table-shell-using-do-loops/m-p/655634#M196702</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-06-09T21:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table shell using do loops</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-table-shell-using-do-loops/m-p/655635#M196703</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/111564"&gt;@HitmonTran&lt;/a&gt;&amp;nbsp; Please try if you like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data shell;
	do ord1= 1 to 5;
	  _n_=0;
    	do ord2= 2 ,5 ,6 ,7 ,8 ,9 ,12 ,13 ,14 ,15 ,16 ,17 ,18 ,19;
			_n_+1;

			do ord3= 0 to 6;
				if _n_&amp;gt;1 and ord3=0 then
					continue;

				/*summary statistics*/
				output;
			end;
		end;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jun 2020 21:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-table-shell-using-do-loops/m-p/655635#M196703</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-06-09T21:12:13Z</dc:date>
    </item>
  </channel>
</rss>

