(AP) -- U.S. stocks perked up after a downbeat start to eke out a small gain Wednesday.
Consumer companies were among the big gainers on a day when investors sized up a mixed bag of new data on the U.S. manufacturing, housing and automobile industries. Telecommunications stocks lagged the rest of the market.
Investors have been looking for clues in the latest economic figures to gauge the likelihood that the Federal Reserve will raise its key interest rate at the central bank's next meeting of policymakers later this month.
"The market is in a holding pattern," said Quincy Krosby, market strategist at Prudential Financial. "Everything now is being viewed via the eye of the Fed in order to ascertain whether and if we get a rate hike this summer."
The Dow Jones industrial average rose 2.47 points, or 0.01 percent, to 17,789.67. The Standard & Poor's 500 index added 2.37 points, or 0.1 percent, to 2,099.33. The index remains within 2 percent of its all-time high set in May 2015.
The Nasdaq composite index gained 4.20 points, or 0.1 percent, to 4,952.25.
The latest gains helped nudge the Dow and S&P 500 higher for the year. The Dow is up 2.1 percent, while the S&P 500 is up 2.7 percent. The Nasdaq is off 1.1 percent.
The major stock indexes opened lower on Wednesday, echoing a slide in markets in Europe and Asia as traders considered new reports on China's manufacturing sector, including one suggesting a weaker outlook for the nation's factories.
Investors also got an early look a mix of new U.S. data. The Commerce Department said construction spending fell in April by the biggest amount in five years, dragged down by declines in housing, commercial construction and spending on government projects.
Separately, car shopping site Kelly Blue Book projected that U.S. auto sales slumped 7 percent in May, usually one of the strongest months of the year for the U.S. auto industry. The drop is the biggest monthly sales decline since August 2010.
Most major automakers reported lower sales in May compared to the same month a year ago, including General Motors and Ford Motors. Shares in GM lost $1.06, or 3.4 percent, to $30.22, while Ford slid 38 cents, or 2.8 percent, to $13.11.
Auto dealership chain CarMax also took a hit, dropping $1.57, or about 3 percent, to $52.09.
Meanwhile, the Institute of Supply Management said that U.S. factories expanded for the straight month in May, helped by a weaker U.S. dollar.
"It's another data point in the direction of things being OK," said Jason Pride, director of investment strategy at Glenmede.
Investors' outlook perked up by late afternoon around the time when the Federal Reserve released its latest Beige Book, a snapshot of the U.S. economy that the central bank's policymakers use to inform their actions.
Another key factor: the government's next monthly update on nonfarm hiring, due out Friday.
"It's been a mixed picture, but with enough elements in the picture to keep the Fed in play to raise rates," Krosby said.
Beyond economic data, investors kept an eye on companies reporting quarterly results or outlooks.
Michael Kors led all companies in the S&P 500 index, climbing 6.6 percent after it reported that strong online sales and new store locations helped boost its fiscal fourth-quarter revenue. The retailer's results topped Wall Street's expectations. The stock gained $2.83 to $45.55.
Cracker Barrel vaulted 8.4 percent after the restaurant chain reported strong earnings growth for its fiscal third quarter. The stock added $12.74 to $164.22.
Other companies didn't fare as well.
Under Armour slumped 3.9 percent after the sports apparel maker slashed its full-year revenue guidance, saying that the closure of Sports Authority stores will hurt its sales. A bankruptcy court recently decided to approve the liquidation of privately held Sports Authority, which sold Under Armour goods, rather than a restructuring or sale. Under Armour shed $1.48 to $36.25.
Markets in Europe closed lower. Germany's DAX fell 0.6 percent, while France's CAC 40 slid 0.7 percent. Britain's FTSE 100 lost 0.6 percent. The downbeat data on China's factories weighed on markets in the world's second-largest economy and elsewhere in Asia.
Hong Kong's Hang Seng index fell 0.3 percent. Japan's Nikkei 225 finished 1.6 percent lower, while South Korea's Kospi slipped less than 0.1 percent. Australia's S&P/ASX 200 slumped 1 percent.
Benchmark U.S. crude oil slipped 9 cents to close at $49.01 a barrel in New York. Brent crude, which is used to price international oils, slid 17 cents to close at $49.72 a barrel in London.
In other energy futures trading, natural gas rose 9 cents, or 4.1 percent, to close at $2.38 per 1,000 cubic feet. Wholesale gasoline was little changed at $1.62 a gallon and heating oil was also flat at $1.50 a gallon.
Among metals, gold fell $2.80 to $1,214.70 an ounce, while silver slid 7 cents to $15.93 an ounce. Copper shed 2 cents to $2.07 a pound.
Bond prices rose. The yield on the 10-year Treasury note fell to 1.84 percent from 1.85 late Tuesday.
In currency markets, the dollar weakened to 109.54 yen from 110.59 yen in Tuesday's trading. The euro rose to $1.1186 from $1.1126.