Stocks closed flat in another thinly traded session on Wednesday as Greece remained in a standstill over accepting tough reforms in exchange for a bailout critical to avoiding a chaotic default.

Underlying confidence kept the Dow near an almost four-year high notched on Tuesday, though trading has been quiet since last week's stellar employment report. The S&P and Nasdaq are both up 0.3 percent so far this week while the Dow is essentially unchanged.

Randy Frederick, director of trading for Charles Schwab in Austin, Texas, said he would use any pullback on Greece as a buying opportunity. And if the situation there gets resolved, we'll move higher even faster.

Greek party leaders gathered on Wednesday to agree to reforms demanded by the European Union and the International Monetary Fund after delays.

European Central Bank policymakers were still divided on what contribution the bank could make to a restructuring of Greece's sovereign debt, sources said. The ECB has ruled out joining private creditors in voluntarily accepting a reduction in the value of the Greek bonds it holds.

We would take a hit if Greece is unable to come to a deal, but lately we've been decoupling from Europe as markets catch up to how strong the economy appears to be, said Frederick.

Dow component Walt Disney Co rose 0.7 percent to $41.27 a day after it reported quarterly profit that topped expectations.

Of the 315 companies in the S&P 500 that have reported earnings to date, 61 percent have come in above analysts' expectations, a rate below that of previous quarters.

Cisco Systems Inc, another Dow component and a bellwether for the networking industry, rose 2.4 percent to $20.93 in extended trading after reporting adjusted second-quarter earnings that beat expectations. Shares of Groupon Inc, the largest daily deal company, plunged 7.6 percent to $22.70 after the bell after it unexpectedly posted an adjusted quarterly loss, even as revenue almost tripled from the prior year.

The Dow Jones industrial average was up 5.75 points, or 0.04 percent, at 12,883.95. The Standard & Poor's 500 Index was up 2.91 points, or 0.22 percent, at 1,349.96. The Nasdaq Composite Index was up 11.78 points, or 0.41 percent, at 2,915.86.

The Dow on Tuesday marked its highest close since May 2008; stocks have rallied from late last year on central bank action and signs of an improving economy.

On Wednesday, high-profile Wall Streeters raised eyebrows with their endorsement of stocks.

Laurence D. Fink, chief executive of BlackRock, the world's largest money manager, told Bloomberg Television that investors should be 100 percent in stocks.

That followed bullish comments from the staff of renowned market bear Nouriel Roubini. Gina Sanchez, Roubini's director of equity and allocation strategy, told CNBC that the rally has some legs.

The Dow has gained 21 percent since early October and has retraced over 80 percent of its bear market slide from 2007 to early 2009. The blue-chip index is now about 10 percent away from the all-time high it hit in October 2007, while the S&P and Nasdaq are both on track for a sixth week of gains.

The speed and magnitude of the gains have some suggesting a pullback could be imminent. While major indexes are slightly higher for the week, the CBOE Volatility index, which is considered a gauge of investor fear and generally moves inversely to the S&P, has spiked 6.3 percent.

Polo Ralph Lauren Corp surged 9.2 percent to $171.49 after the clothing maker reported better-than-expected results for the holiday quarter and raised its margin forecast.

Energy shares were the biggest decliners, as Brent and U.S. crude oil futures pared gains after a report showed a build-up in U.S. crude inventories. The S&P energy index fell 0.5 percent. Exxon Mobil Corp was one of the biggest losers on the Dow, falling 0.6 percent to $85.32.

Volume was light, with about 6.97 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, below last year's daily average of 7.84 billion.

About 56 percent of stocks traded on the New York Stock Exchanged closed in positive territory while 54 percent of the Nasdaq closed higher.

(Reporting By Ryan Vlastelica; Editing by Leslie Adler)