Chief executives at the nation's middle-market firms remain upbeat about the business environment, but pessimism appeared to increase in the second quarter, according to a new survey.

More than 96 percent of 351 CEOs surveyed said that their business outlook was neutral to positive, which was down from 99.17 percent in the first quarter, according to the survey by Marcum LLP, a national accounting and advisory firm. Marcum tracks the outlook of CEOs quarterly.

The proportion of executives with a negative outlook more than tripled from the first quarter to the second quarter, going from less than 1 percent (0.83 percent)  to 3.49 percent.

The survey’s reading on CEO optimism for the second quarter translates to a weighted average of 7.41, down from 7.77 in the first quarter, according to Marcum.

Of the CEOs surveyed, about 89 percent were from companies with revenues of $1 billion or lower in 2017; 11 percent were from companies with revenues of more than $1 billion.

“Interestingly, there was also a diversity of opinion among CEOs, even within the same industries, with some assessing their business outlook at the highest rating and others selecting the lowest. This will be something to keep our eyes on in the next two quarters and beyond,” said Jeffrey M. Weiner, Marcum’s chairman and chief executive officer.

Among the other survey findings, talent recruitment remained the top priority for CEOs in 11 industry categories, with 36 percent citing this as their top concern. Workforce training was the second-most cited priority among CEOs, with 22 percent citing this category compared to 19.91 percent in the first quarter.

For financial company CEOs, technology was seen as the top investment priority over the next year, followed by geographic expansion. Technology and the regulatory environment were also seen as the top factors influencing their businesses in the second quarter.