Stocks rose modestly on Wednesday after encouraging economic data and as investors continued to favor shares that have seen strong gains.

Industrial production rose in November, while consumer prices ticked up, suggesting the Federal Reserve will complete its $600 billion bond-buying program to help the economy.

Persistent worries about euro-zone debt pressured markets after Moody's warned Spain its credit rating could be downgraded.

Individual stocks, including regional banks, benefited as investors looking to boost returns scooped up stocks that have performed well. The financial sector also advanced after UBS raised its price target on several banks.

The KBW regional bank index <.KRX> shot up 0.7 percent and has gained more than 13 percent for the year. Regions Financial Corp was up 2.1 percent at $6.33.

But other shares with recent strong gains waned as investors opted to lock in profits instead. Netflix Inc added 0.3 percent to $178.87, but the stock has surged some 225 percent this year.

Stocks ended flat both Monday and Tuesday as indexes succumbed to afternoon selling.

Wednesday's action into the close could give an indication of how much upside there is left to the year, said Kurt Brunner, portfolio manager at Swarthmore Group in Philadelphia.

The economic numbers are giving us this upside, but I want to see how we end today. If we roll over today, that would say to me we're probably going to plod through to the end of the year, Brunner said.

The Dow Jones industrial average <.DJI> gained 32.81 points, or 0.29 percent, to 11,509.35. The Standard & Poor's 500 Index <.SPX> dipped 0.19 of a point, or 0.02 percent, to 1,241.40. The Nasdaq Composite Index <.IXIC> added 6.55 points, or 0.25 percent, to 2,634.27.

The S&P 500 is up about 11.4 percent for the year.

Since 1990, stocks in the S&P 500 have averaged a gain of 1.90 percent over the last 10 trading days of the year, according to Bespoke Investment Group. The year's winners heading into the last two weeks outperform, while the year's losers continue to lag.

Caterpillar Inc rose 2.3 percent to $94.18 after RBC raised its price target to $108 from $98.

Investor Carl Icahn said he had agreed to buy power producer Dynegy Inc for $665 million in cash, just three weeks after a bid by private equity firm Blackstone Group failed to win over Dynegy shareholders. Dynegy's stock rose 3.1 percent to $5.62.

(Reporting by Leah Schnurr: Editing by Jan Paschal)