Stocks held onto slim gains on Wednesday as the U.S. Federal Reserve gave a lukewarm economic assessment, saying high unemployment still justified a $600 billion bond-buying program that has helped equities rally in the last few months.

The Dow Jones industrial average <.DJI> was up 25.35 points, or 0.21 percent, to 12,002.54. The Standard & Poor's 500 Index <.SPX> rose 6.01 points, or 0.47 percent, to 1,297.19. The Nasdaq Composite Index <.IXIC> added 20.74 points, or 0.76 percent, to 2,739.99.

The S&P 500 earlier hit a 29-month high as investors snapped up commodity and technology shares.