* Pre-Greek vote preps by central banks reassure * Volatility seen persisting ahead of Greek election * Read on NY manufacturing comes in weaker than expected * Indexes up: Dow 0.5 pct, S&P 0.6 pct, Nasdaq 0.6 pct By Ryan Vlastelica NEW YORK, June 15 (Reuters) - U.S. stocks rose on Friday on optimism major world central banks will take coordinated action if the closely watched election in Greece this weekend results in market turmoil. The news offset the latest round of weak U.S. economic data, which pointed to sluggish growth domestically. Officials of the Group of 20 leading industrialized nations told Reuters that central banks of major economies would take steps to stabilize markets and prevent a credit squeeze, if necessary. That spurred sharp gains late in Thursday's session, erasing the S&P's decline for the week. The benchmark index is now up 0.9 percent on the week, even as uncertainties persist over the euro zone. Material and energy shares were among the biggest gainers of the day, with the two closely tied to economic growth prospects. Cabot Oil & Gas rose 2.1 percent to $35.78 and Alcoa Inc was up 1.4 percent at $8.77. "The kind of action being described in Europe would be a positive step, although I view it as only one of ten things that needs to be done to stabilize the situation," said David Carter, chief investment officer at Lenox Wealth Advisors in New York. Investors fear the Sunday elections in Greece may set the nation on a path to an exit from the euro zone. That possibility, along with questions about the effectiveness of a bank bailout plan in Spain, has spurred volatility in a thinly traded week. "Watching the market is like watching a NASCAR race, with us ripping down one direction one minute and then up the other direction the next, making no progress at the end of the day," Carter said. The Dow Jones industrial average was up 66.11 points, or 0.52 percent, at 12,718.02. The Standard & Poor's 500 Index was up 7.28 points, or 0.55 percent, at 1,336.38. The Nasdaq Composite Index was up 15.51 points, or 0.55 percent, at 2,851.84. A gauge of manufacturing in New York state fell sharply in June, though it still showed growth, while a read on consumer sentiment was also below consensus forecasts. "What's shocking is how disappointing the data is still," said Lawrence Glazer, managing partner at Mayflower Advisors in Boston. "It reflects the general malaise on Main Street right now. Consumers and investors have been hit with a wave of uncertainty." Recent economic indicators, including Thursday's unexpected rise in jobless claims, have pointed to sluggish growth in the U.S. economy. However, U.S. equities have largely tracked European developments in recent months, and shrugged off weak domestic data on occasion. Some investors think the lackluster U.S. data increases the chances that the Federal Reserve will signal more easy money to counter slowing growth when it releases its policy statement next Wednesday at the close of a two-day meeting. The Wall Street Journal reported late Thursday Microsoft Corp would buy business software company Yammer Inc for $1.2 billion, citing a person familiar with the matter.