The market's gains were held in check by a slump in energy stocks and Hewlett-Packard's 13 percent plunge. In a meeting with analysts and investors, Meg Whitman, H-P's CEO, predicted weak earnings and sales for the foreseeable future.
The Dow Jones rose 12.25 points to close at 13,494.61. The Standard & Poor's 500 index gained 5.24 points to 1,450.99.
"The price action today seems boring, but the economic data is pretty strong," said Ryan Detrick, senior technical strategist at Schaeffer's Investment Research.
The Institute for Supply Management said its index of service companies, which includes everything from financial firms to clothing stores, rose in September to the highest level since March. The index reached 55.1. Economists had estimated it would drop to 53.4.
But concerns over an economic slowdown in Europe, China and the U.S. helped push the price of crude oil down $3.75 to $88.14 a barrel. Energy stocks fell sharply as a result. After H-P, Chevron had the worst loss in the Dow, giving up $1.82 to $116.14.
"The U.S is looking better than a lot of places in the world," Detrick said. "The big question is: Are they going to pull us down with them?"
In other trading, the Nasdaq composite index rose 15.19 points to 3,135.23. The yield on the benchmark 10-year U.S. Treasury note ended the trading day at 1.61 percent, the same as late Tuesday.
Hewlett-Packard plunged after CEO Meg Whitman said a successful turnaround of the computer maker is a long way off. Profits will likely fall by more than 10 percent next year, she said. HP's stock lost $2.22 to $14.91.
Payment processor ADP said Wednesday that U.S. companies put 162,000 more workers on their payrolls last month. That's still below August's total of 189,000, and not enough to put a dent in the 8.1 percent employment rate.
Trading could remain calm this week while investors look ahead to the government's monthly jobs report Friday and a new round of quarterly corporate earnings reports next week.
Economists expect the unemployment rate edged up to 8.2 percent in September from 8.1 percent in August. And the unofficial start to the earnings season starts next Tuesday when the aluminum company Alcoa posts its results.
The Dow and the S&P 500 have crept higher in the first week of October. The Dow is up 0.4 percent and the S&P 500 is up 0.7 percent.
Among other stocks making big moves Wednesday:
• Discount chain Family Dollar Stores surged $2.56 to $68.56 after posting stronger net income and sales. The store's customers also spent more money on each sale.
• Monsanto fell $1.97 to $88.59. The purveyor of corn seeds, herbicides and other agricultural products posted a wider loss and reported sales that fell short of Wall Street's expectation.
• Best Buy jumped 79 cents to $17.76 on reports that the company's founder has teamed up with a group of private equity firms to take over the electronics chain.