US stocks were flat on Thursday, with gains in the tech sector offseting sluggish factory activity data and lower oil prices, as investors exercised caution ahead of a key payrolls report on Friday.

A report from the Institute of Supply Management showed US factory activity contracted for the first time in six months in August as new orders and production tumbled, but data on the labour market pointed to a pickup in third-quarter economic growth.

“The ISM data was, in a word, disappointing, because many investors and market participants were expecting to see a more robust number, something more in line with recent trend,” said Peter Kenny, senior market strategist at Global Markets Advisory Group, in New York.

“It has forced investors to reconsider the landscape, not go blindly into the narrative that spells out a certainty about interest rates being bumped up in September.”

Energy shares, down 0.3 per cent, also weighed as oil prices declined on worries about a supply glut. US crude settled off 3.5 per cent at $43.16 a barrel, while Brent settled 3.1 per cent lower at $45.45.

But gains in tech companies such as Hewlett Packard Enterprise , up 3.2 per cent, and Apple, up 0.6 per cent, helped keep losses in check.

A 4.5-per cent gain in Charter Communications also helped lift the Nasdaq after S&P Dow Jones Indices said the cable services company would replace EMC Corp in the S&P 500 after the close of trading on September 7.

The economic data comes ahead of Friday’s monthly non-farm payrolls data, which could influence the Fed’s decision on the timing of the next interest rate hike.

Solid performance in the labour market has spurred hawkish comments from some Fed officials in recent weeks. On Thursday, Cleveland Fed President Loretta Mester had said the US labour market is at full strength and the Federal Reserve needs to be on a path of gradual interest rate increases.

Traders have priced in a 27-per cent chance of a hike in September, up slightly from the 24 per cent probability in the prior session. The odds for a hike in December stand at 54.4 per cent, edging up from 53.6 per cent on Wednesday, according to the CME Group’s FedWatch tool.

The Dow Jones industrial average rose 18.42 points, or 0.1 per cent, to 18,419.3, the S&P 500 lost 0.09 points to 2,170.86, and the Nasdaq Composite added 13.99 points, or 0.27 per cent, to 5,227.21.

Declining issues outnumbered advancing ones on the NYSE by a 1.10-to-1 ratio; on Nasdaq, a 1.14-to-1 ratio favoured advancers.

The S&P 500 posted 15 new 52-week highs and 2 new lows; the Nasdaq Composite recorded 113 new highs and 28 new lows.

About 6.36 billion shares changed hands in US exchanges, compared with the 5.98 billion daily average over the last 20 sessions.