U.S. stocks edged up on Wednesday as stronger-than-expected earnings and economic data underpinned hopes about the recovery, but gains were limited by a dip in energy and other commodity-related shares.

Shares of Deere & Co rose 5.2 percent to $56.56 after the farm equipment maker reported quarterly earnings that topped expectations and raised its fiscal 2010 outlook for machinery sales growth.

The results follow the upbeat trend in fourth-quarter U.S. corporate results, with more than 70 percent of the Standard & Poor's 500 companies beating analyst earnings estimates so far, according to Thomson Reuters data.

Energy shares weighed on the market as the U.S. dollar rose against the euro, reversing Tuesday's move. Strength in the U.S. currency tends to pressure dollar-denominated commodities.

Today you're getting some good earnings numbers and not bad numbers on the economy, and that's the cyclical uptick in the economy, but momentum is fading, said Jim Awad, managing director at Zephyr Management in New York.

Nothing has changed in Greece or any of the other (affected) countries, he said. Uncertainty about the future for debt-burdened Greece has hit the euro in recent weeks.

The Dow Jones industrial average <.DJI> was up 26.30 points, or 0.26 percent, at 10,295.11. The Standard & Poor's 500 Index <.SPX> was up 2.20 points, or 0.20 percent, at 1,097.07. The Nasdaq Composite Index <.IXIC> was up 2.91 points, or 0.13 percent, at 2,217.10.

Also helping sentiment, Federal Reserve data showed U.S. industrial output rose more than expected in January, with gains recorded across all major categories.

Shares of diversified manufacturer United Technologies advanced 1.6 percent to $66.95.

Investors also await minutes from the last Federal Reserve meeting, which could include more detail on the rate-setting committee's expectations for ending its ultra-loose monetary policy.

On the New York Mercantile Exchange, oil futures were up 8 cents at $77.09, after trading lower. Shares of Chevron were down 0.4 percent at $72.71 and an index of energy shares <.GSPE> declined 0.4 percent.

On the Nasdaq, shares of Whole Foods Market Inc jumped 11.4 percent to $33.99 after the company raised its full-year outlook and at least two brokerages upgraded the stock.