Stocks rose slightly as traders analyzed the latest data for clues on the outlook for inflation, economic growth, and the Federal Reserve's policy path.

The S&P 500 swung between small gains and losses throughout the session. Treasury two-year yields, which are more sensitive to imminent Fed decisions, rose to around 4.2%. The dollar was steady.

Business activity in the United States unexpectedly increased to nearly a one-year high, raising the prospect of further inflation. The S&P Global flash April composite purchasing managers index increased by 1.2 points to 53.5, its highest level since May.