Stock trading on the last day of the year was much as it was for all of 2002: hesitant and dreary.

The markets were largely flat, closing with small improvements or losses on a day that traders and economists said was a fitting end to a year of short-lived gains and many disappointments. The Dow Jones industrial average advanced 8.78 points, or 0.1 percent, to close at 8341.63. The Dow had its worst December since 1931.

The tech-heavy Nasdaq composite index fell 4.03 points, or 0.3 percent, to 1335.51, and the Standard & Poor's 500-stock index rose 0.43 points, or 0.05 percent, to 879.82.

It was a year of historic drops. The Dow sank 1679.87 points, or 16.8 percent, in 2002 -- its worst performance since 1977. The Nasdaq lost nearly a third of its value, falling 614.89 points -- its third-worst decline and the first time it has fallen for three straight years. The S&P 500 plunged 268.26 points, or 23.4 percent.

"The market is punch-drunk," said Matthew W. Johnson, head of stock trading at Lehman Brothers. "It's taken a beating the entire year and is anticipating the next punch, whether from more lousy economic data or the fact that we can't get out from underneath the Iraq situation."

New survey data indicate that consumer confidence, the one pillar supporting a feeble economy, seems to be tottering. The Conference Board reported yesterday that its consumer confidence index fell nearly four points in December, to 80.3, after rebounding to 84.9 in November after a five-month slide. Economists had expected a measure of 85 to 86.

"The major factor dampening consumers' spirits has been the rising unemployment rate and the discouraging job outlook. Weak retail sales over the holidays clearly reflect the current mood of consumers," said Lynn Franco, director of the Conference Board's Consumer Research Center. "Until there is an improvement in labor market conditions, there is not likely to be a significant upturn in consumer confidence."

The anemic volume and narrow price ranges in recent Wall Street trading suggest that increasing worries over North Korea's nuclear program and the possibility of war with Iraq continue to dampen consumer and investor confidence.

"We've got an extremely dichotomous situation," said Ned Riley, chief investment strategist at State Street Global Advisors. "We're all hoping for an economic recovery led by spirited American consumers while we're constantly barraging them with threats of attack and nasty warfare."

"This market is clearly caught between those two scenarios," Riley added.

Among the bright spots yesterday was Tyco International, which climbed $1.73, or 11.3 percent, to close at $17.08. On Monday, the company issued the results of an internal investigation into accounting and corporate governance under former chief executive L. Dennis Kozlowski. Tyco said the accounting errors and aggressive accounting policies did not indicate "systemic" fraud at the conglomerate.

The stocks of a few venerable consumer products makers managed to avoid the carnage in 2002. Eastman Kodak gained 19.1 percent for the year, while Procter & Gamble rose 9.4 percent and 3M rose 4.3 percent.

Leading the decliners was Home Depot, down 52.9 percent. General Electric, which suffered from revelations of former chief executive Jack Welch's extravagant retirement perks and mounting labor trouble, skidded 39.2 percent.

Other Indicators

* The New York Stock Exchange composite index rose 1.31, to 472.87; the American Stock Exchange index rose 3.59, to 824.38; and the Russell 2000 index of smaller-company stocks rose 0.86, to 383.09.

* Advancing issues outnumbered declining ones by 7 to 4 on the NYSE, where trading volume rose to 1.09 billion shares, from 1.06 billion on Monday. On the Nasdaq, advancers outnumbered decliners by 7 to 5 and volume totaled 1.1 billion, up from 1.03 billion.

* The price of the Treasury's 10-year note fell $1.56 per $1,000 invested, and its yield rose to 3.82 percent, from 3.80 percent on Monday.

* The dollar rose against the Japanese yen and fell against the euro. In late New York trading, a dollar bought 118.74 yen, up from 118.47 late Monday, and a euro bought $1.0503, up from $1.0482.

* Light, sweet crude oil for February delivery settled at $31.20 a barrel, down 17 cents, on the New York Mercantile Exchange.

* Gold for current delivery rose to $347.60 a troy ounce, from $343.40 on Monday, on the New York Mercantile Exchange's Commodity Exchange.

Chicago Mercantile Exchange clerks celebrate the close of 2002 trading.