If there is an instance of occurrence=0, will it always be for the first observation for an ID?
Here's an approach that makes a reasonable guess about how to handle that question:
data want;
set have;
by ID;
if first.ID then increment=0;
retain increment;
if occurrence=0 then increment=1;
occurrence = occurrence + increment;
run;