OK, my mistake.
If you break the dataset by YEAR, the IDENTITY variable will maintain the ordering sequence (ordered), IF and ONLY IF the dataset is splitted sequentially, say processed through datastep (which processes each OBS sequentially). As Doc@Duke, said, you cannot assume the ordering sequence with PROC SQL, unless you explicitly say so. That is because SQL uses an optimizer that will choose the best strategy/technique to perform the task, and this may not involve a sequential processing of the dataset.
I agree with Scott, before making any further assumption about your task and the way you are doing it, you should share with us a bit of your code.
Greetings from Portugal.
Daniel Santos at
www.cgd.pt