The S&P 500 and the Nasdaq rose on Wednesday as several corporate executives gave positive outlooks that eased concerns about the global recession, while a better-than-expected profit from AT&T lifted technology shares.

But falling oil prices pressured shares of big energy companies, pushing the Dow industrials lower. Exxon Mobil was among the index's top drags.

JPMorgan recommended that Caterpillar should make up a larger part of investors' portfolios, and the company's shares rose 6.3 percent to $33.36, making them a top driver in the S&P 500.

AT&T Inc rose 3.5 percent to $26.17 after profit fell less than expected, and an analyst said its iPhone partnership with Apple Inc is starting to help rather than hurt profits.

Apple, which reports results after the closing bell, was a top gainer on the Nasdaq, up 1.4 percent at $123.46.

The market seems to be navigating earnings season in good form, said David Katz, chief investment officer at Matrix Asset Advisors in New York.

The market is looking beyond the current recession and focusing on the fact that companies are navigating it and expecting to improve later in the year, he said.

The Standard & Poor's 500 Index <.SPX> gained 2.92 points, or 0.34 percent, to 853.00. The Nasdaq Composite Index <.IXIC> rose 18.58 points, or 1.13 percent, to 1,662.43. But the Dow Jones industrial average <.DJI> dropped 11.31 points, or 0.13 percent, to 7,958.25.

Gilead Sciences Inc jumped 7.2 percent to $46.89 and was the top boost on the Nasdaq after quarterly profit beat estimates on increases sales of its drugs to treat the virus that causes AIDS.

Boeing Co kept the Dow's losses in check after the big U.S. aircraft manufacturer and defense contractor lowered its full-year outlook, but the range was still above Wall Street's expectations, according to Reuters Estimates. Its shares were up 1.9 percent at $37.35.

But Morgan Stanley fell 2.4 percent to $24.06 after it posted its second straight quarterly loss and slashed its dividend.

Banks have helped lead the six-week rally that sent the broad S&P 500 up more than 26 percent from March's bear market lows.

Exxon Mobil Corp and Chevron Corp were among the Dow's top drags as U.S. oil futures prices dropped. Exxon fell 1.4 percent to $65.31, and Chevron was down 0.6 percent at $64.52.

(Editing by Jan Paschal)