Thank you so much for your reply! This solution works absolutely fine! As I'm not used to working with proc sql, I think I will start with the solution posted above using only the data step, which I'm more familiar with. Regards, Alexander
... View more