BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello ,

I run the code -

data revenue;
set sales;
if Laptopmodel="AT3600" then do;
if warranty=1 then revenue=units_sold*(1199.99+39);
if warranty=0 then revenue=units_sold*1199.99;
proc print data = revenue;
run;

the log -

89 data revenue;
90 set sales;
91 if Laptopmodel="AT3600" then do;
92 if warranty=1 then revenue=units_sold*(1199.99+39);
93 if warranty=0 then revenue=units_sold*1199.99;

93 if warranty=0 then revenue=units_sold*1199.99;
-
117
ERROR 117-185: There was 1 unclosed DO block.

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.REVENUE may be incomplete. When this step was stopped there were 0
observations and 8 variables.


Kindly suggets.

regards ,

markc
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
The documentation on the IF statement and the DO statement has some very good examples:
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000202239.htm
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000201951.htm

The ERROR message is quite clear on what is wrong:
ERROR 117-185: There was 1 unclosed DO block.


A DO statement or DO block is closed with an END statement.

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).
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001331122.htm

cynthia

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 3131 views
  • 0 likes
  • 2 in conversation