<?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: Do statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245688#M45877</link>
    <description>&lt;P&gt;I am not sure what is the output you seeking is look like exactly ;&lt;/P&gt;
&lt;P&gt;But maybe this is what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A; 
do y=1 to 200; 
	do i = 1 to 5 while (y-i&amp;gt;0); 
		x=(y-i)*3;
		output;  
	end; 
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So you will have two loops one for &lt;STRONG&gt;y&lt;/STRONG&gt; and the other for&lt;STRONG&gt; i &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;and each loop should&amp;nbsp;end by &lt;STRONG&gt;END;&lt;/STRONG&gt;&amp;nbsp;statment.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jan 2016 10:57:51 GMT</pubDate>
    <dc:creator>mohamed_zaki</dc:creator>
    <dc:date>2016-01-24T10:57:51Z</dc:date>
    <item>
      <title>Do statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245687#M45876</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have trouble running this. I would like values for x. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data A;&amp;nbsp;&lt;/P&gt;&lt;P&gt;y=1 to 200;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do i = 1 to 5 while (y-i&amp;gt;0);&amp;nbsp;&lt;/P&gt;&lt;P&gt;x=(y-i)*3;&lt;/P&gt;&lt;P&gt;output; &amp;nbsp;&lt;/P&gt;&lt;P&gt;end;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2016 10:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245687#M45876</guid>
      <dc:creator>sasbeginner</dc:creator>
      <dc:date>2016-01-24T10:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Do statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245688#M45877</link>
      <description>&lt;P&gt;I am not sure what is the output you seeking is look like exactly ;&lt;/P&gt;
&lt;P&gt;But maybe this is what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data A; 
do y=1 to 200; 
	do i = 1 to 5 while (y-i&amp;gt;0); 
		x=(y-i)*3;
		output;  
	end; 
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So you will have two loops one for &lt;STRONG&gt;y&lt;/STRONG&gt; and the other for&lt;STRONG&gt; i &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;and each loop should&amp;nbsp;end by &lt;STRONG&gt;END;&lt;/STRONG&gt;&amp;nbsp;statment.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2016 10:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245688#M45877</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-24T10:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Do statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245689#M45878</link>
      <description>I am trying to find all possible values for x when y is 1 to 200…&lt;BR /&gt;&lt;BR /&gt;i.e. if i=5 and y=10 then x=15…&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 24 Jan 2016 10:59:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245689#M45878</guid>
      <dc:creator>sasbeginner</dc:creator>
      <dc:date>2016-01-24T10:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Do statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245690#M45879</link>
      <description>&lt;P&gt;Then the above code is what you want.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2016 11:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245690#M45879</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-24T11:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Do statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245694#M45880</link>
      <description>&lt;P&gt;Perhaps your loops should begin like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do y=1 to 200;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do i = 1 to y-1;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2016 14:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Do-statements/m-p/245694#M45880</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-01-24T14:44:01Z</dc:date>
    </item>
  </channel>
</rss>

