By Victor Reklaitis and Sara Sjolin, MarketWatch

NEW YORK (MarketWatch)--U.S. stocks closed with modest gains Friday in light trading, building on their weekly and monthly advances, as largely upbeat U.S. economic data appeared to outweigh overseas worries.

The S&P (SPX) rose 6.62 points, or 0.3%, to close at 2,003.36 for its 32nd record close this year, according to preliminary data.

The Dow Jones Industrial Average(DJI) gained 18.75 points, or 0.1%, to end at 17,098.32, while the Nasdaq Composite(RIXF) tacked on 22.58 points, or 0.5%, to 4,580.27.

Readings on consumer sentiment and Chicago-area business conditions surpassed expectations, though the Commerce Department reported an unexpected dip in consumer spending. In overseas news, Russian President Vladimir Putin lashed out at Ukraine, and U.K. authorities warned a terror attack is highly likely.

What strategists are saying: Stocks received a lift from a "quite good" reading on consumer sentiment, and investors also may be anticipating a strong August jobs report next week, said James Liu, global markets strategist at J.P. Morgan Funds.

He warned against reading too much into Friday's action, as many traders were on vacation ahead of Labor Day weekend. "Next Tuesday we'll find out what people really think about the market," Liu told MarketWatch.

Stocks are likely to keep advancing through year's end thanks to earnings growth, though gains won't be as strong as in the past few years, said David Lafferty, chief markets strategist for Natixis Global Asset Management. "Our outlook is for stocks to continue to grind higher," he told MarketWatch.

S&P's best August in 14 years: The S&P 500 gained 3.8% for the month, representing the benchmark's best August performance since 2000. The S&P 500 also achieved its largest monthly percentage jump since February, when it rose 4.3%.

For the week, the S&P 500 tacked on nearly 0.8%. The Dow scored advances of 0.6% for the week and 3.2% for the month, while the Nasdaq climbed 0.9% for the week and 4.8% for August.

"We've had more waves, but the underlying current is still pretty good," said Lafferty of Natixis. The waves in August have included Europe weakening and Russia-Ukraine worries, but the U.S. has seen largely positive economic data and "pretty solid" second-quarter earnings, he said.

"It was a very strong month in terms of performance," said Liu at J.P. Morgan Funds. Investors waiting for a relatively steep drop before buying didn't get what they wanted, he noted. The S&P 500 pulled back 4% from late July to early August, then rallied to new records.

The S&P and Dow notched for their fourth up week in a row, representing their best streak since an eight-week advance in October and November.

Movers and shakers: Avago Technologies Ltd. (AVGO) closed up 7.5%, performing best among S&P 500 stocks.

Wall Street analysts raised their price targets for the Apple supplier in the wake of another better-than-expected profit report and ahead of the coming iPhone 6 launch. Shares in Apple Inc. (AAPL) finished up 0.2%.

(Read more about Friday's jumpiest stocks in the Movers & Shakers column http://www.marketwatch.com/story/splunk-rallies-freds-to-close-60-stores-2014-08-29.)

Other markets: European equities finished slightly higher, while stocks in Asia closed mixed. Oil prices (CLV4) gained, while gold (GCZ4) moved lower. The dollar (DXY) edged up against most rivals.

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

Apple (NASDAQ:AAPL)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Apple Charts.
Apple (NASDAQ:AAPL)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Apple Charts.