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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2907 views
  • 0 likes
  • 2 in conversation