S&P ends flat as energy and materials weigh

Traders work on the floor of the New York Stock Exchange (NYSE) February 9, 2016. REUTERS/Brendan McDermid

NEW YORK (Reuters) - The S&P 500 ended flat on Wednesday, cutting its gains late in the session as commodity-related shares fell, while comments by Federal Reserve Chair Janet Yellen offered a mixed view on the rate outlook. The Dow Jones industrial average <.DJI> was down 99.51 points, or 0.62 percent, to 15,914.87, the S&P 500 <.SPX> had lost 0.39 points, or 0.02 percent, to 1,851.82 and the Nasdaq Composite <.IXIC> had added 14.83 points, or 0.35 percent, to 4,283.59. (Reporting by Marcus E. Howard; Editing by Nick Zieminski)