Hi, I am not sure if this question has been asked, and I am new to SAS, so any help would be appriciated. I have a table like the following: ID Value 1 0 1 100 1 200 1 0 2 0 2 0 2 0 2 100 2 0 3 0 3 100 3 200 And I would like to create a flag for the first non-zero values for each ID. The resulting table will be: ID Value Flag 1 0 0 1 100 1 1 200 0 1 0 0 2 0 0 2 0 0 2 0 0 2 100 1 2 0 0 3 0 0 3 100 1 3 200 0 Note that the observations are already sorted by ID and then Date, so I don't want to change the order of the observations. Is there any easier way to do this? Thank you so much!
... View more