TOKYO (AP) _ The U.S. dollar surged against the Japanese yen Wednesday, while stock prices, bolstered by traders intent on an auspicious yearend, climbed to a record high close.

The dollar opened at 125.17 yen and closed at 125.27 yen, up 0.40 yen from Tuesday's close of 124.80 yen.

An exchange dealer at the Bank of Tokyo said the dollar's strength followed an overnight rise in New York, resulting ''from a dollar-buying drive based on actual demand'' for the currency. In New York, the dollar closed at 124.92 yen Tuesday.

On the Tokyo Stock Exchange, the Nikkei Stock Average of 225 selected issues, which regained the 30,000-point level Tuesday, added another 108.07 points, or 0.36 percent, closing at a record 30,159.00 points.

Navy- and gray-suited traders jammed the floor of the Tokyo Stock Exchange and loudly applauded the end of 1988 trading at midday. The market will reopen for the new year on Jan. 4, 1989, with another half-day session.

Traders said major Japanese brokerages were determined to end the year with a bang, and their strong presence encouraged other investors.

''Today's market is like a festival market,'' said Ichitaro Watanabe, a dealer at Nikko Securities Co. ''Japanese brokerages customarily push share prices up at the yearend.''

The market's key indicator broke the 30,000-point mark on Dec. 7, when it closed at 30,050.82, but the index slipped back the following day on profit- taking. It regained the 30,000-point level Tuesday, when it closed at 30,050.93 points.

Analysts said the market outlook was favorable. Japan's brisk economic growth is expected to continue through mid-1989.

''My estimate is the current economic growth will continue at least until the middle of next year, and then it may show a little slowdown,'' said Mike Morizumi at Merrill Lynch's Tokyo office. ''But unless some dramatic changes occur ... the market's bullishness will probably continue.''