Stocks rose, with the three major indexes posting simultaneous record closes for the second time in less than a week.