@Madhav4114 wrote: In this , if I add one more duplicate row then it will flag 0 in between
Then do this:
data want;
set have;
by id date;
flag = (not first.date or not last.date);
run;
... View more
May want the options /nocum nopct norow nocol on the tables statement.
Or move to another proc like Tabulate or Report that have more control/flexibility for display.
... View more
If you just need the count, you can do like this:
data want;
retain count -1; /* the first record should set count to 0 */
set have end=done;
by flag notsorted;
count+first.flag;
if done;
keep count;
run;
... View more