@ari wrote:
@Kurt_Bremser: Thanks, what if the values need to be replaced with values other than 0. I have updated the text to represent such a case. Is there a way to identify and specifically modify the first row (of the two rows with same time and week values)
Then we need to know from where to retrieve those replacement values.
If you need to replace only the first line of a multiple of identical lines, I suggest
- run a data step where you set a counter variable from _n_
- sort the dataset by descending counter (you reverse the order completely)
- use by as already suggetse in the next data step, and set your values only when last. and not first. of the last by variable is met
- recreate the original order by sorting by counter; if you use out= in the proc sort to create a new dataset, you can drop counter there.
... View more