Hi all,
I have data in the following fashion (below) and want to remove all observations that happen after action=1 within an ID group (So the bold rows below would be removed in this example).
ID Date Action_Occurs
1234 07/01/2008 0
1234 01/06/2008 0
1234 11/07/2008 0
1234 16/07/2008 1
1234 08/08/2008 0
1234 02/10/2008 0
4567 27/02/2008 0
4567 22/06/2008 0
4567 20/07/2008 0
4567 12/09/2008 1
7891 14/02/2008 0
7891 08/04/2008 0
7891 20/04/2008 0
7891 04/07/2008 1
7891 14/07/2008 0
7891 27/09/2008 0
7891 16/10/2008 0
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...)