The dollar held fairly steady in foreign exchange markets yesterday, with modest intervention by central banks in Europe and Japan.

The dollar moved in a narrow range, between 141.35 and 141.70 yen compared with 141.90 and 142 yen in New York on Friday, and at 1.7915 to 1.7925 West German marks compared with 1.7975 in New York on Friday.

But there was a highly nervous undertone to the market, reflecting rumors that the July trade deficit, to be announced on Friday, might be as much as $16 billion, higher than the June deficit of $15.7 billion.

"If that number is correct, then it will be impossible to keep the dollar at present levels," said Shigeru Tokunaga, an exchange dealer at the Fuji Bank of New York.

Tokunaga said that yesterday's dollar prices around 141 yen and 1.79 marks were sure to slide unless the U.S. trade deficit shows an improvement. But if the July figure turns out to be no worse than $13.5 billion -- as a few banks are predicting -- then the dollar/yen rate might temporarily rise to 145, Tokunaga said.

Like other dealers in the exchange market, Tokunaga credited yesterday's stability to last week's half-point boost in the Federal Reserve discount rate. "{Chairman Alan} Greenspan showed the market his intention to try to keep the dollar at these levels," he said.

Although European monetary sources said that there had been "concerted intervention" involving as many as five central banks, including the Bundesbank and the Bank of England, dealers here said that the amounts were small. The agreement to move together in support of the dollar reportedly had been made over the weekend at a Basle, Switzerland, meeting of banking officials that included Greenspan.

In Tokyo, the dollar support by the Bank of Japan was said to be less than $20 million. There was no evidence that the Federal Reserve Bank of New York intervened, dealers said.

The modest support was enough to keep the dollar stable or even push it slightly higher. One dealer explained that while bearish sentiment was prevalent, some speculators are already "short" dollars and do not want to extend those positions until the July trade numbers are released.

The Dow Jones news service quoted one London dealer as saying that market operators "weren't prepared to take on the {central} banks, but they weren't going to run away, either."

Tokunaga, representing one of the chief yen/dollar brokers, said that whichever way the July trade figures happen to play, the exchange markets eventually will "test" the 140-yen level. He said he regards that as a "crucial, psychological point" because the Japanese government has indicated that it will make a strong effort to prevent a dollar decline below 140 yen.

Presumably, the Bank of Japan would intervene heavily in an effort to prevent the dollar from declining into the 130s because the resulting appreciation of the yen would cause further economic distress to the Japanese economy -- both in terms of lower exports and higher unemployment at home.

The test of wills would then be drawn between central bank forces -- the others would be expected to line up with the Bank of Japan -- and market forces. Most experts think that, barring some change in the underlying economic fundamentals, the market forces would eventually win over the central banks.

For example, asked for his view yesterday on the ability of governments to hold exchange rates in some predetermined zones, Felix Rohatyn of Lazard Freres said: "There's not enough money in the world for the central banks to be able to do it."