Reputation: 3082
I am preparing for sas base exam and wonder why the variable prod can still be generated while no initialization of the variable. So for every element will set to 0 by default?
data word;
do until(prod gt 6);
prod + 1;
end;
run;
Upvotes: 0
Views: 48
Reputation: 321
This has to do with the + sign. This is a special statement in SAS. It is equivalent of writing: retain prod 0;
More info can be found here: https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289454.htm
Good luck!
Upvotes: 4