The S&P 500 Index and other benchmarks posted solid monthly advances as investors waited for more earnings reports and the July jobs report.