I have tried retain statements, if statements, first., last. etc... but can't quite crack it. This seems a quite simple task so am quite frustrated that I can't seem to figure it out in SAS. ANY help on this is much appreciated!
(apologies for the layout of the example data - couldn't see a way of uploading images etc...)