By Kate Gibson

The stock market's enthusiasm over the government's "cash for clunkers" program waned Thursday in the face of data suggesting consumers exchanged old cars for newer models at the expense of other retail spending.

Investors were taken back by the Commerce Department's report that U.S. retail sales fell 0.1% in July, as opposed to expectations sales would gain 0.8%. Excluding autos, retail sales declined 0.6% versus an expected gain of 0.1%. .

"The decline in retail sales is quite startling to say the least. The cash for clunkers program was expected to have had quite an effect on retail sales [but] motor vehicle and parts rose only 2.4%; expectations had looked for a gain more than double. Sales at auto and other motor vehicle dealers were up just 2.8%, a healthy gain to be certain but far less than many economists expected," Dan Greenhaus, chief economic strategist, Miller Tabak & Co., wrote in an emailed note.

The data helped offset early-day investor cheer, bolstered in part by earnings results from retail goliath Wal-Mart Stores Inc. (WMT), leaving the major stock indexes meandering between positive and negative turf.

The Dow Jones Industrial Average (DJI) was lately up 11.26 points at 9,372.87. The S&P 500 Index (SPX) rose 3.75 points to 1,009.56, while the technology-led Nasdaq Composite (RIXF) gained 8.4 points to stand at 2,007.12.

Shares of auto retailers, including AutoZone Inc. (AZO) and AutoNation Inc. (AN), were among Thursday's heaviest weights on the consumer-discretionary sector, with shares of both down about 3%.

"All the cash-for-clunkers [program] did was steal sales from other retailers. We'd argue that even more damage was done, as consumers who did turn in their clunkers likely surrendered assets with at least some residual value for debt and an equity stake in a sharply deteriorating asset," said T.J. Marta, chief market strategist, Marta on the Markets LLC.

Speaking ahead of Thursday's retail report, Howard Ward, chief investment officer of Gamco Growth Fund, pointed to the government's incentive program as evidence that the consumer "is not dead [but] still has a pulse."

"These are not Wall Street types trading in their Beemers," Ward added.