Strong earnings from IBM and other technology companies nudged the stock market higher Thursday, but a trio of weak economic reports kept the gains in check.
IBM surged 4 percent after it posted a jump in profits late Wednesday even as revenue fell. It marked the 38th consecutive quarter that IBM's net income rose over the previous year. IBM leapt $7.09 to $195.34.
The Dow Jones industrial average rose 34.66 points to close at 12,943.36 on Thursday, the third straight day of gains.
"One thing is dominating today and it's tech earnings," said Lawrence Creatura, portfolio manager at the mutual fund manager Federated Investors. "Earnings have been better than a lot of people expected. That could still change, but so far, so good."
Analysts forecast that earnings at S&P 500 companies shrank 1.5 percent in the April-through-June period versus a year ago, according to researchers at S&P Capital IQ. If that turns out to be true, it will be the worst earnings season since the summer quarter of 2009.
Despite the modest gains, utilities and consumer staples lagged behind the market, usually a sign that investors were willing to take on risk.
eBay jumped 9 percent after the company reported that its second-quarter net income doubled, thanks to higher revenue from its PayPal online payments business and its e-commerce websites. eBay rose $3.73 to $44.19.
The market wavered in early trading, flipping from gains to losses and back again, after a measure of manufacturing in the mid-Atlantic region came in much weaker than economists had expected. Two other economic reports also released at 10 a.m., homes sales and leading economic indicators, were also weak.
American Express lost 4 percent, the largest drop in the Dow, after its earnings missed Wall Street's expectations. Slower growth in Europe weighed on the credit-card company's results as international revenue fell 4 percent. Amex lost $2.06 to $56.23.
Morgan Stanley fell 74 cents to $13.25, a drop of 6 percent. The investment bank's income and revenue fell far short of what analysts expected, dragged down by dismal results from trading stocks and bonds.
The Dow is now up 1.3 percent for the week, and the S&P 500 index 1.5 percent.
Among other stocks making big moves:
— Walgreen Co. soared 12 percent, the largest gain in the S&P 500. The Walgreen pharmacy chain and Express Scripts reached an agreement in which Walgreen will once again fill prescriptions from people in the Express Scripts network. That ended a dispute between the two companies. Walgreen gained $3.65 to $34.62.
— Textron jumped 12 percent. The maker of Cessna planes reported that its quarterly earnings nearly doubled. The results trounced Wall Street analysts' estimates, thanks to rising demand for its Citation line of business jets and Bell helicopters. Textron gained $2.74 to $26.50.
— Johnson Controls sank 8 percent. Earnings for the maker of auto parts and building equipment fell far short of expectations, partially a result of a weaker euro and sluggish demand from Europe. The company said it expects Europe to remain a problem. Johnson Controls' stock lost $2.25 to $26.07.