Let's start with this part
I need to create 3 datasets(d1 d2 d3)
This makes the rest of your problem more difficult to code, and in fact is completely unnecessary (and a bad idea as well). Keep everything in one data set.
Now that we have skipped the unnecessary creation of separate data sets, you can do the summing very easily
proc summary data=blib.usorders04(where=(total_retail_price>100)) nway;
class order_type customer;
var total_retail_price;
output out=want sum=total_sales;
run;
The output data set that I have named WANT has everything you need.
--
Paige Miller