U.S. stocks edged higher Friday as data reassured investors about the economy's health, but with major gauges at record levels some investors opted to take profits before the weekend.

Wal-Mart Stores Inc. (WMT) jumped more than 4 percent after the world's biggest retailer announced plans for a $15 billion stock buyback and more moderate expansion of supercenter stores in an effort to improve sales.

A government report showing a stronger-than-expected rise in new jobs in May got Friday's session to a strong start, sending the Dow industrials to an all-time high and the S&P 500 index to its highest in more than seven years. A gauge of U.S. manufacturing activity also rose, lending support.

But while the data boosted optimism about profits, this week's run-up led some investors to sell some of the biggest advancers, including plane maker Boeing Co. (BA) and technology company Apple Inc. (AAPL).

"Everyday we've gotten more M&A news and private equity deals, putting big support under the market, but people are afraid to push it much higher," said Rich Parker, head of trading at the Stanford Group in New York.

"In spite of China earlier in the week, the market is still higher, but people are really thinking it's getting ahead of itself."

The Dow Jones industrial average was up 10.89 points, or 0.08 percent, at 13,638.53. The Standard & Poor's 500 Index rose 3.16 points, or 0.21 percent, at 1,533.78. The Nasdaq Composite Index was up 6.77 points, or 0.26 percent, at 2,611.29.

Wal-Mart jumped 4.7 percent to $49.82 on the New York Stock Exchange and was the biggest gainer in both the blue-chip Dow average and the broad S&P index.

Wal-Mart's move to scale back supercenter openings boosted shares of its rivals, including grocers Kroger Co. , which jumped 2.8 percent, and Safeway Inc., which gained 4.6 percent.

The profit-taking followed two months of strong gains, which led the S&P 500 to reach record closes on Wednesday and Thursday. Earlier in the session, the Dow hit a lifetime high of 13,692.

Shares of big manufacturers gained, including chemical maker DuPont (DD), which rose 1.6 percent to $53.17.

But shares of Boeing slipped 0.6 percent to $99.98, while on the Nasdaq shares of Apple dropped 2.1 percent.

Employers added 157,000 jobs to nonfarm payrolls in May, outstripping Wall Street's forecasts. The Institute for Supply Management's index of national factory activity rose more than expected, as factory managers began replenishing depleted inventories in May. And consumers were optimistic, with the final May reading in a Reuters/University of Michigan survey showing consumer sentiment also exceeding expectations.