That doesn't work. My example was for a single identity.
If there had been an identity 12 in year 2009 with one or several records where N1 would equal 1, then the two records for identity 11 for year 2009, would also have been selected for the new data set.
As recommended at your other post, you may consider using macro code to generate unque SAS data files for each ID and YEAR combination encountered based on your input SAS file.
Start with a PROC SQL skeleton program which uses WHERE and selects one ID and YEAR to create a specific-named file. Then once you get that logic to work as desired, look at creating a SAS macro driven by called macro variable parameters -- these would be DISTINCT combination of ID and YEAR.