U.S. stocks rose on Thursday as a flurry of strong earnings reports lifted big names like Apple, but underwhelming economic data and caution ahead of the long weekend kept gains in check.

The S&P 500 bumped up once more close to 1,340, a level that has triggered selling plenty of times this month. Some see a failure to convincingly rise above 1,344, the recent high in the benchmark, as a bearish technical signal.

Factory activity in the U.S. Mid-Atlantic region slowed sharply in April and the number of claims for unemployment insurance fell less than expected last week, implying the economy was struggling to regain momentum.

But continuing with a recent swing in sentiment, Apple Inc , up 2.9 percent at $352.25, posted results that smashed Wall Street's expectations, joining Intel, United Technologies and other names that have increased the perception of a healthy corporate America.

Companies are proving the concern over expectations was unwarranted because corporate earnings are looking very strong, said Eric Kuby, chief investment officer of North Star Investment Management Corp in Chicago.

What's holding back the rally today are some of the macro numbers, whereas the company-specific information seems very positive.

The Dow Jones industrial average <.DJI> gained 35.69 points, or 0.28 percent, to 12,489.23. The Standard & Poor's 500 Index <.SPX> rose 6.47 points, or 0.49 percent, to 1,336.83. The Nasdaq Composite Index <.IXIC> added 15.91 points, or 0.57 percent, to 2,818.42.

For the second day in a row, the Dow approached a three-year peak. The Dow industrials climbed as high as 12,491.19, their highest intraday level since early June 2008.

Travelers Cos Inc gave the Dow its top boost after the large property insurer reported a 30 percent rise in quarterly profit as it recorded higher investment income. Shares rose 2.9 percent to $60.85.

Even Morgan Stanley , which reported a near 50 percent drop in profit, posted gains as the decline was smaller than feared, thanks to stronger-than-expected fixed-income trading results. Its shares gained 2.8 percent to $26.77.

But McDonald's Corp was off 2 percent at $76.87, after the world's largest hamburger chain warned of accelerating food price inflation.

General Electric Co lost 2.1 percent to $19.97 as results failed to impress investors even after the largest U.S. conglomerate reported an 80 percent surge in first-quarter profit and raised its quarterly dividend.

Biogen Idec was the S&P 500's top gainer, up 20.1percent at $103.93 after it released promising data from a clinical trial of an experimental multiple sclerosis drug.

Volume is expected to remain light on Thursday before a three-day weekend. U.S. and many global markets are closed on Friday in observance of Good Friday.

As you approach every weekend, there seems to be some concern about being long, said North Star's Kuby. It's becoming part of the dynamic.

(Reporting by Rodrigo Campos; Editing by Jan Paschal)