S&P 500 closes flat, giving up most of the gains in the final mi...