S&P 500 stalls at record level, set for best August in 36 years