Stocks that outperform in a weak economy helped the Dow and S&P 500 eke out gains on Thursday as concerns about faltering growth and inflation prompted investors to seek out less volatile names.

The Dow Jones industrial average <.DJI> gained 14.16 points, or 0.12 percent, to end unofficially at 12,285.15. The Standard & Poor's 500 Index <.SPX> add just 0.11 of a point, or 0.01 percent, to 1,314.52. The Nasdaq Composite Index <.IXIC> dipped 1.30 points, or 0.05 percent, to close unofficially at 2,760.22.

(Reporting by Ed Krudy; Editing by Jan Paschal)