THAT PRICE-FIXING CASE brought against the nations that compose OPEC has ended, at least for now, and it has ended much the way it began. A federal judge dismissed the suit Thursday in a flurry of legalisms, most of which have precious little to do with the real world. That, of course, is all this case consisted of from the day the International Association of Machinists filed it. It was a effort, typically American in its originality, to force a distressing international situation into a system of law and courts never designed to handle such a thing.

The judge, for example, ruled that the machinists had not been able to prove that oil prices in the United States have been directly affected by OPEC'S actions. As a matter of legal proof, that is probably right; oil prices here are not synchronized with OPEC prices, which have tended to follow rather than lead the market. But if you are going try to tell people in a gasoline line that OPEC is not responsible for at least part of that $1-a-gallon price, you'd better be prepared for the worst.

Judge A. Andrew Hauk's order of dismissal, however, rests primarily on a finding that the OPEC nations are carrying out "sovereign acts to reduce or conserve products for their own sovereign benefit, not for profit." That, too, may be technically true. But it is, above all, a finding designed to get around a provision in American law that might have given the courts durisdiction over this case if the OPEC nations were engaging in trade for profit.

There is little doubt -- in the real world, as distinct from the legal world -- that the OPEC nations have engaged in what would be an illegal price-fixing conspiracy if it were undertaken by American corporations. But that does not mean American courts are the right place for an attack on the arrangement, regardless of what an attenuated reading of American antitrust law may indicate. It is one thing for a court to order Exxon to stop fixing prices and pay damages for what it has done, but quite another for the same court to enter the same kind of order against, let us say, Saudi Arabia.

That's where the theory of this case first went off the track. It couldn't help relieve the oil shortage and it might have made the situation worse -- regardless of what legalisms exist to give the case intellectual respectability. Unfortunately, the U.S. government decided it could not afford, for domestic political reasons, to intervene on behalf of the OPEC nations to tell the judge as much. Fortunately, he discovered it for himself.