Dr pepper could be found at :
I've seen root beer around.
I'm pretty sure I saw it at Sam's - on Gongti Xilu - next to all the "other" beers.
A&W went bankrupt in Beijing a few years ago.
You can find A&W root beer at many supermarkets. (as Portable Alpha mentioned above)