Sentiment among midsize companies also rose, while that for small businesses improved but remained negative.