* Apple rises after Icahn comments
* Endo down after agreeing to buy Par Pharmaceutical
* Ann rises after Ascena Retail takeover offer
* Indexes up: Dow 0.08 pct, S&P 0.2 pct, Nasdaq 0.4 pct (Updates to afternoon)
By Tanya Agrawal
May 18 (Reuters) - U.S. stocks edged higher, with both the Dow Jones industrial average and the S&P 500 hitting records, as weak economic data suggested the Federal Reserve will hold back on raising rates any time soon.
The Dow touched an intraday high of 18,297.28, surpassing its previous record set in early March, while the S&P 500 touched 2127.82, climbing past the high it hit last week.
The National Association of Home Builders/Wells Fargo Housing Market index fell to 54 from 56 in April. Economists polled by Reuters had forecast a rise to 57.
The U.S. economy is struggling to rebound strongly enough for the Federal Reserve to raise interest rates before September, analysts have said.
"Right now with the way things are going, especially with the yield curve getting steeper, it's going to be less and less likely the Fed will raise rates in September," John Burke, CEO of Burke Financial Strategies in New York.
"It looks to be at the very end of the year or maybe even early 2016."
Data released on Friday showed that industrial output slipped and consumer sentiment fell.
Seven of the 10 major S&P 500 sectors were higher, with the teleservices index's 0.58 percent rise leading the way.
AT&T provided the biggest boost to the index, rising 1.3 percent.
At 12:45 p.m. ET (1645 GMT) the Dow Jones industrial average was up 15.21 points, or 0.08 percent, at 18,287.77, the S&P 500 was up 4.56 points, or 0.21 percent, at 2,127.29 and the Nasdaq Composite was up 19.66 points, or 0.39 percent, at 5,067.95.
Apple's shares rose 1.1 percent to $130.21 after billionaire investor Carl Icahn said the stock was "still dramatically undervalued" and that it should be trading at $240.
The stock's rise was the biggest factor for the rise in all the three major indexes.
Endo International fell 4 percent to $81.84 after the generic drugmaker said it would buy privately held Par Pharmaceutical from TPG Capital in a $8.05 billion deal.
Altera rose 5.9 percent to $47.08 after the New York Post reported that the company had resumed talks with Intel on a possible deal. Intel was little changed.
Cal-Maine Foods jumped 10 percent to a record high of $60.43 after brokerage Stephens upgraded the egg supplier's stock to "overweight" from "equal weight", Benzinga reported.
Ann Inc gained 18.6 percent to $45.93 after the company agreed to be bought by Ascena Retail for $2.15 billion in cash and stock. Ascena fell 3.8 percent to $13.66.
Alibaba fell 1.6 percent to $87 after a group of luxury goods makers sued the company on Friday, contending that the Chinese e-commerce giant knowingly made it possible for counterfeiters to sell their products throughout the world.
Declining issues outnumbered advancers on the NYSE by 1,483 to 1,477. On the Nasdaq, 1,637 issues rose and 1,065 fell for a 1.54-to-1 ratio favoring advancers.
The S&P 500 index posted 31 new 52-week highs and 2 new lows; the Nasdaq Composite recorded 96 new highs and 37 new lows. (Additional reporting by Sweta Singh in Bengaluru; Editing by Saumyadeb Chakrabarty)