GettyImages-531728546
Traders work on the floor of the New York Stock Exchange. Getty

This story was updated at 4:35 p.m. EDT.

U.S. stocks closed at a 7-month high on Monday as Federal Reserve Chair Janet Yellen painted a mostly upbeat picture of the economy but gave little sense of when a rate hike may be coming.

Yellen's remarks, which were likely her last public comments before a policy meeting next week, followed Friday's dismal monthly jobs report, which raised concerns over the ability of the economy to absorb a rate hike as early as June.

Yellen called the jobs report "disappointing," but said "one should not attach too much significance to a single report."

"Yellen's speech tells me that the Fed is going to follow through with what all the Fed governors have been saying in the past six weeks," said Paul Nolte, portfolio manager at Kingsview Asset Management in Chicago.

The Dow Jones Industrial Average closed the day up 113 points, or 0.6 percent, to 17,920, off its earlier high. The S&P 500 index was up 10 points, or 0.5 percent, at 2,109 by the close, and the Nasdaq Composite was up 26 points, or 0.5 percent, at 4,969.

Energy shares also boosted the market after oil ended higher for a third straight session. The S&P energy index rose 2 percent, leading gains in the benchmark S&P 500.

The gains pushed the market a bit closer to all-time highs last reached in May 2015. The S&P 500 is now just about 21 points shy of its all-time closing high.

The financial index also pared some gains and was higher. The index dropped 1.4 percent on Friday, weighing on the entire market, as chances of a rate hike in June faded.

AbbVie was down 3 percent at $63 after Cowen cut its rating on the stock to "market perform" from "outperform."

Data from Reuters were used to report this story.