The S&P 500 eked out a small gain while the Dow Jones Industrial Average declined after a volatile trading session on Wednesday, with weakness in sectors such as consumer staples and financials offsetting strong gains in the energy and industrial indexes.

Higher oil prices helped out energy stocks while transport stocks such as CSX helped the industrial sector. However, IBM’s 7.5 percent drop was the largest drag on the S&P after the technology company’s quarterly profit margins missed Street targets.

CSX rose 7.8 percent after exceeding earnings estimates. Its news lifted other railroads and helped to push the Dow Jones Transport index up 1.7 percent.

United Continental gained 4.8 percent and lifted other airline stocks after reporting a better-than-expected quarterly profit.

Trading was uneven, with the Dow swinging between positive and negative territory while the S&P 500 gave up most of its gains in the last few minutes of trading.

In late afternoon trade the S&P briefly lost ground after a Federal Reserve report said robust business borrowing, rising consumer spending, and tight labor markets indicated the economy is on track for continued growth, with trade war risks being the one big outlier.

Wall Street expects S&P 500 first-quarter earnings to grow 19.4 percent, according to Thomson Reuters data.

Oil futures settled up 2.9 percent due to a decline in domestic crude inventories and after sources signaled top exporter Saudi Arabia wants to see crude prices closer to $100 a barrel. The S&P energy sector rose 1.6 percent.

The CBOE Volatility index ended up 0.35 point at 15.60, its first daily increase after six days of declines.

Lam Research fell 4 percent on analyst concerns about a slowdown in demand for its chip equipment. The Philadelphia SE Semiconductor index finished the trading day down one percent.

Approximately 6.46 billion shares changed hands on the major domestic equity exchanges, as compared to the almost 7 billion share daily average for the past 20 trading days.

Economic Growth Continues Beige Book Says

“Robust” business borrowing, rising consumer spending, and tight labor markets indicate the economy remains on track for continued growth, the Federal Reserve reported on Wednesday, with the risks of a global trade war the one big outlier.

In its periodic “Beige Book” summary of contacts with businesses in its 12 regional districts, the Fed said the overall outlook among businesses “remained positive,” but that many were worried about the Trump administration’s use of tariffs.

“Contacts in various sectors including manufacturing, agriculture, and transportation expressed concern about the newly imposed and/or proposed tariffs,” the central bank said in its report, which covered the period from March to early April.

In fact, the word “tariffs” appeared 36 times in Wednesday’s report after not appearing at all in the previous Beige Book published March 7. It was referenced as a factor affecting prices or as a potential concern for the outlook in 10 of the 12 regional banks’ activity summaries.

Otherwise the economy appeared to be moving ahead steadily, with some evidence that the tax cuts approved in December may have begun filtering through to business spending and investment.

Several Fed districts reported a rise in commercial and industrial lending, from a “robust” 17 percent year-over-year increase in St. Louis to “solid” growth in Atlanta and “healthy” demand in Cleveland. There was “markedly stronger growth in loan volumes was seen in commercial and industrial, and commercial real estate,” the Dallas Fed reported.

That dovetails with other Fed data showing commercial and industrial (C&I) loan growth, a closely watched gauge of business credit demand, has picked up pace in the last two months after slowing sharply through 2017 and into the start of 2018.

Year-over-year C&I growth for all U.S. banks accelerated to 3.4 percent in early April, its fastest in more than a year, after falling to near zero at the end of last year.

Demand has been strongest among lenders outside of the top 25 largest banks, Fed data shows. Small banks registered year-over-year C&I loan growth of 6.2 percent in early April, the largest in more than two years.

The increase in business borrowing could be a precursor to the sort of investment boom that Fed officials hope would follow from the recent steep cut in corporate taxes.

That would likely support the core view among Fed policymakers for at least two and perhaps three more interest rate increases this year. The Fed raised rates at its March policy meeting but is not expected to do so when it meets again in about two weeks.

Price increases nationally were described as “moderate,” with steel costs rising “dramatically” in some areas due to the Trump administration’s announcement of tariffs on imports of the metal.

Businesses repeated recent frustrations with labor shortages across a variety of sectors including high-skilled jobs in engineering, information technology and health care. There were also shortages seen in construction and transportation.

In some cases that is leading to long-anticipated wage increases, though overall wage growth remained “only modest.”

“Businesses were responding to labor shortages in a variety of ways, from raising pay to enhancing training to increasing their use of overtime and/or automation,” the Fed reported. “Upward wage pressures persisted but generally did not escalate.”

The Beige Book was prepared by the Federal Reserve Bank of Dallas based on information collected on or before April 9, 2018.