data _null_;
set hash.bankholidays;
retain total 0;
format date :date9.;
set hash.oyster;
datetime = datepart(datetime);
format datetime :date9. ;
if date eq datetime then do;
total = total + amount; end;
put "total =" total;
run;
This gives me a popup dialog box in eclipse:
Multiple SET/MERGE statements in a data step
I’m wondering what’s going on here? It seems to be saying that you can’t have a set statement within a set statement, but I’m sure I’ve done it before.
eg.
data data_ex.giftwrap_ribbon_final;
set data_ex.giftwrap_w_ribbon_fl;
if not missing (first) and not missing (last) then do;
do i = first to last;
set data_ex.ribbon (keep=ribbon_colour) point = i;
output;
end;
end;
else do;
ribbon_colour = '';
output;
end;
run;
could I get some clarification here?
Also, about that last put. How do I tell it to execute the put after the set statement has finished?
You need to wrap the set statment in a do loop and use pointers.