* Wall St ticks up in choppy trade, S&P ends negative for quarter
* Markets seen volatile until Greek referendum
* Euro near session lows versus U.S. dollar (Updates to U.S. market close, adds comment)
By Rodrigo Campos
NEW YORK, June 30 (Reuters) - Stocks ended slightly higher on Wall Street in volatile trade on Tuesday and a global equities gauge was flat, while the euro fell as Greece grappled with a looming deadline on a debt payment to the IMF.
Markets held on to some chance of resolution even as German Chancellor Angela Merkel played down any hopes of a last-minute deal with Greece and said there will be no new negotiations before a vote planned for Sunday. Greeks face a referendum that EU partners say will amount to a choice between staying in the euro or leaving.
Greece submitted a new two-year aid proposal to its creditors, calling for debt restructuring in what seemed like a last-ditch effort by Athens to resolve its impasse with lenders. Talks between Greece and its creditors broke down over the weekend, causing Greece to close its banks and impose capital controls.
"There is time for a rabbit to be pulled of a hat in respect to the Greek problem," said Don Townswick, director of equity strategies at insurance asset manager Conning in Hartford, Connecticut.
"Everything pointed to a small rebound," he said, after "a significant amount of uncertainty was priced in with the selloff yesterday."
Major U.S. indexes closed a negative month on Tuesday, weighed by the heavy selling on Monday on the heels of the Greek drama.
On Tuesday, the Dow Jones industrial average rose 23.16 points, or 0.13 percent, to 17,619.51, the S&P 500 gained 5.48 points, or 0.27 percent, to 2,063.12 and the Nasdaq Composite added 28.40 points, or 0.57 percent, to 4,986.87.
June was the first negative month in three for the major indexes, with the S&P 500 down for the first quarter in ten. The Nasdaq continued its quarterly winning streak at 10, the longest on record.
The MSCI All-Country World equity index was flat, and ended 0.3 percent lower for the quarter. The pan-European FTSEurofirst 300 index lost 1.3 percent on Tuesday and was off 4.7 percent for the quarter.
The S&P 500 rose as much as 0.8 percent on the day and briefly traded negative also. Analysts said they expect markets to remain volatile at least until the Greek referendum.
In commodities, oil futures bounced back with both Brent and U.S. crude closing the quarter with strong gains.
Brent was up 2.2 percent at $63.40 a barrel and closed down more than 3 percent for June, but added nearly 15 percent in the quarter. U.S. crude gained 1.1 percent at $59.09 and ended up nearly 24 percent for the quarter.
The euro was last down 0.9 percent against the U.S. dollar at $1.1134.
The deadline for the Greek payment to the IMF expires Tuesday at 6 p.m. ET (2200 GMT). However, lingering optimism for a Greek resolution limited the euro's losses, analysts said.
"There's a little bit more optimism on one, the referendum will take place coming up on Sunday, and that we are likely to get a 'yes' vote," said Alan Ruskin, global head of FX strategy at Deutsche Bank in New York.
Treasuries yields edged up in yet another choppy market. Benchmark 10-year Treasury notes were off 6/32 in price to yield 2.3513 percent.
The 30-year bond fell 13/32 in price to yield 3.1195 percent. (Reporting by Rodrigo Campos, Richard Leong, Barani Krishnan and Sam Forgione in New York, additional reporting by Lionel Laurent and Christopher Johnson in London; Editing by Dan Grebler and Meredith Mazzilli)