U.S. stock indexes struggled to rise on Monday as an earnings-driven rally from last week faded and economic-sensitive sectors as well as Microsoft fell although gains in Boeing and Tesla limited the losses.

Planemaker Boeing Co gained 6.5% after a Reuters report the U.S. aviation regulator approved its inspection and modification plan to resume deliveries of 787 Dreamliners.

Amid increasing uncertainty in markets, the S&P 500 and the Nasdaq posted in July their biggest monthly percentage gains since 2020 on solid quarterly results and on hopes the Federal Reserve would be less aggressive with interest rate hikes.

The U.S. central bank has raised rates by 2.25 percentage points this year and has vowed to be data-driven in its approach toward future hikes.

"We have two negative GDP reports, a Fed that says the policy rates are now near neutral and yet a number of people think that the Fed has a lot further to go," said Chuck Lieberman, chief investment officer at Advisors Capital Management.

"It's not like we don't know that growth has slowed a lot and it could be that the economy is bottoming, the circumstance right now is pretty uncertain."

Data showed U.S. manufacturing activity slowed-less-than-expected in July and there were signs that supply constraints are easing..

The report came on the heels of surveys that showed factories across Asia and Europe struggled in July as flagging global demand and China's strict COVID-19 curbs slowed production.

Demand worries dragged oil prices lower, pushing the S&P 500 energy sector down 2.8% and making it top loser among the 11 sectors. [O/R]

All eyes are now on the monthly U.S. jobs report on Friday, which will be parsed for cues for the Fed's next moves.

Worries about a recession have hurt stock markets this year, with the benchmark index down 13.4% as investors adjust their expectations on economic growth and corporate profits in the face of tightening financial conditions.

However, the earnings season has showed companies were far more resilient in the second quarter than estimated.

Of the 283 S&P 500 companies that have reported results, 78.1% have topped profit estimates, as per Refinitiv data. The long-term average is 66.1%.

At 12:58 p.m. ET, the Dow Jones Industrial Average was up 36.91 points, or 0.11%, at 32,882.04, the S&P 500 was down 1.66 points, or 0.04%, at 4,128.63 and the Nasdaq Composite was up 21.18 points, or 0.17%, at 12,411.87.

Tesla Inc rose 1.2% after signing two supply deals for battery materials.

PerkinElmer Inc jumped 6.4% after the medical diagnostic firm said it will sell some of its businesses along with the brand name to private equity firm New Mountain Capital for up to $2.45 billion in cash.

Meanwhile, U.S. House of Representatives Speaker Nancy Pelosi was set to visit Taiwan on Tuesday. China warned that its military would never "sit idly by" if she visited the self-ruled island claimed by Beijing.

Advancing issues outnumbered decliners by a 1.25-to-1 ratio on the NYSE and by a 1.16-to-1 ratio on the Nasdaq.

The S&P index recorded five new 52-week highs and 31 new lows, while the Nasdaq recorded 51 new highs and 84 new lows.