THE RAPID RISE of the yen against the dollar is generating vast anxiety in Japan, where it has already caused a wave of bankruptcies. To this country, it has brought an unwelcome ripple of additional inflation. In both countries, there are now urgent questions about what's to be done. The answer is, of course, that nothing is to be done. The whole recent history of the dollar-yen relation is, in fact, a lesson in the very high cost of government's attempts to maintain artificial currency exchange rates.

As recently as the early months of 1976, you could get more than 300 yen for a dollar. By last October, it was down to 250 yen. Currently the rate is teetering barely over 200, with Japan's central bank buying dollars like mad in a desperate effort to keep the price from going farther. When a slide of this magnitude transpires in such a brief time, between two economies that are respectively the first and third most powerful in the world, and are moreover major forces in trade with each other and the rest of the world, the breakage in old relationships and old habits becomes exceedingly costly and painful.

In the long years after World War II, Japan had a small and struggling economy that the United States helped in many ways - among others, by permitting it to maintain an undervalued yen. As time passed, the Japanese economy grew formidably. But instead of adjusting the yen gradually to its rising power, a succession of Japanese and American governments held it well below the value that the market would have set. The full dimensions of that error of procrastination are now being revealed.

An undervalued currency has a pervasive skewing effect on an economy. It constitutes a subsidy to those industries that export. It also constitutes a tax on consumers, forcing up the prices of many things that they must buy. Now this invisible but real subsidy to the exports is being suddenly withdrawn - a matter of particular importance since, in Japan as in most countries, the export industries tend to be the most efficient and the most advanced. While consumers theoretically benefit, most of them are worrying more about jobs than about purchasing power.

The yen's rise has two immediate causes. Japan is running a huge trade surplus. While its government has made repeated promises to work the surplus down, it now seems, to the contrary, to be growing. On the American side, the inflation rate is higher than in Japan and it, too, is rising. As the yen goes up, it makes the inflation worse here. It raises the prices of Japanese goods directly. Indirectly, it permits American companies to raise their prices without fear of being undercut by imports. That effect can be clearly seen in steel. As long as the Japanese trade surplus and the American inflation rate stay high, the yen will keep rising against the dollar.

Up to 1971, governments kept their currencies tied in fixed relations - more or less - to each other. But then the system changed, and now the markets have taken over the job of setting the rates through daily trading. That change is irreversible. The flows of worldwide trade and investment have now reached such a gigantic scale that no government commands the resources to commit itself to fixed rates. Any government that tried it would end only by diminishing its own prosperity and destroying jobs.

That point is worth mentioning, since in the middle of this month President Carter will go to the economic meetings in Bonn where, according to all reports, some of the countries will try to stabilize the currency rates. Among the Europeans, already tied into a community, that's a possibility. But across the two oceans, it's not.