<?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 DO Block in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/DO-Block-in-SAS/m-p/63896#M18172</link>
    <description>Hello ,&lt;BR /&gt;
&lt;BR /&gt;
I run the code -&lt;BR /&gt;
&lt;BR /&gt;
data revenue;&lt;BR /&gt;
set sales;&lt;BR /&gt;
	if Laptopmodel="AT3600" then do;&lt;BR /&gt;
	if warranty=1 then revenue=units_sold*(1199.99+39);&lt;BR /&gt;
	if warranty=0 then revenue=units_sold*1199.99;&lt;BR /&gt;
proc print data = revenue;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
the log -&lt;BR /&gt;
&lt;BR /&gt;
89   data revenue;&lt;BR /&gt;
90   set sales;&lt;BR /&gt;
91       if Laptopmodel="AT3600" then do;&lt;BR /&gt;
92       if warranty=1 then revenue=units_sold*(1199.99+39);&lt;BR /&gt;
93       if warranty=0 then revenue=units_sold*1199.99;&lt;BR /&gt;
&lt;BR /&gt;
93       if warranty=0 then revenue=units_sold*1199.99;&lt;BR /&gt;
     -&lt;BR /&gt;
     117&lt;BR /&gt;
ERROR 117-185: There was 1 unclosed DO block.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
WARNING: The data set WORK.REVENUE may be incomplete.  When this step was stopped there were 0&lt;BR /&gt;
         observations and 8 variables.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Kindly  suggets.&lt;BR /&gt;
&lt;BR /&gt;
regards ,&lt;BR /&gt;
&lt;BR /&gt;
markc</description>
    <pubDate>Wed, 03 Mar 2010 03:20:18 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-03-03T03:20:18Z</dc:date>
    <item>
      <title>DO Block in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Block-in-SAS/m-p/63896#M18172</link>
      <description>Hello ,&lt;BR /&gt;
&lt;BR /&gt;
I run the code -&lt;BR /&gt;
&lt;BR /&gt;
data revenue;&lt;BR /&gt;
set sales;&lt;BR /&gt;
	if Laptopmodel="AT3600" then do;&lt;BR /&gt;
	if warranty=1 then revenue=units_sold*(1199.99+39);&lt;BR /&gt;
	if warranty=0 then revenue=units_sold*1199.99;&lt;BR /&gt;
proc print data = revenue;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
the log -&lt;BR /&gt;
&lt;BR /&gt;
89   data revenue;&lt;BR /&gt;
90   set sales;&lt;BR /&gt;
91       if Laptopmodel="AT3600" then do;&lt;BR /&gt;
92       if warranty=1 then revenue=units_sold*(1199.99+39);&lt;BR /&gt;
93       if warranty=0 then revenue=units_sold*1199.99;&lt;BR /&gt;
&lt;BR /&gt;
93       if warranty=0 then revenue=units_sold*1199.99;&lt;BR /&gt;
     -&lt;BR /&gt;
     117&lt;BR /&gt;
ERROR 117-185: There was 1 unclosed DO block.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
WARNING: The data set WORK.REVENUE may be incomplete.  When this step was stopped there were 0&lt;BR /&gt;
         observations and 8 variables.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Kindly  suggets.&lt;BR /&gt;
&lt;BR /&gt;
regards ,&lt;BR /&gt;
&lt;BR /&gt;
markc</description>
      <pubDate>Wed, 03 Mar 2010 03:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Block-in-SAS/m-p/63896#M18172</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-03T03:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: DO Block in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/DO-Block-in-SAS/m-p/63897#M18173</link>
      <description>Hi:&lt;BR /&gt;
  The documentation on the IF statement and the DO statement has some very good examples:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000202239.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000202239.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000201951.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000201951.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  The ERROR message is quite clear on what is wrong: &lt;B&gt;&lt;BR /&gt;
ERROR 117-185: There was 1 unclosed DO block.&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  A DO statement or DO block is closed with an END statement. &lt;BR /&gt;
&lt;BR /&gt;
I also suggest that you read about step boundaries and DATA step processing to find out more about the RUN statement (to end or stop the DATA step from executing).&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001331122.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001331122.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 03 Mar 2010 05:45:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/DO-Block-in-SAS/m-p/63897#M18173</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-03-03T05:45:41Z</dc:date>
    </item>
  </channel>
</rss>

