Yes. If you run the sample code I've posted you'll see that it does.
You gave an example of id=50, which is new.
For so few transactions you can index the transactions. Or sorting them shouldn't take long anyway. Both methods work.
And the history table is always sorted with either method when you merge.
You'll need a composite index with ID and date.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.