My original SAS data set, DS1, has one variabel, Year.
My first code looks like this:
data DS2;
set DS1;
keep year count;
if year=1996 then count+1;
run;
The program runs and I can check that count has incremented for each year=1996.
Then I tried with this code:
data DS2;
keep year count;
set DS1 end=last;
if last then output;
run;
I expected to have DS2 with one row, and with year value equal to DS1:s last year value and the same value for count as in the first case.
But now DS2 has no observations.
What's wrong with my code?
Anne