The Caterpillar Tractor Co. has been told it will get a long-awaited export license to sell 100-pipe-laying machines to the Soviet Union in a decision which could have far-reaching implications for U.S.-Soviet trade.

A source familiar with the decision said the news was conveyed in a phone call from Commerce Secretary Malcolm Baldridge to Caterpillar Chairman Lee Morgan following a memo to Baldridge from White House Counsellor Edwin Meese III indiccating presidential approval for the $40 million deal.

Although neither the State Department nor the Commerce Department would confirm the deal yesterday, it is now expected to be announced officially next week.

It marks the end of a six-month wrangle in the administration over the proposed sale, during which Pentagon officials argued strongly that no license should be granted, although Secretary of State Alexander M. Haig Jr. is believed to have opposed this view.

The decision will be seen as a victory for Haig over Defense Secretary Caspar Weinberger, and an indication that the administration is prepared to take a pragmatic approach on trade deals with the Soviets which do not involve strategic defense considerations, or the transfer of sophisticated technology.

The company argued that if the Soviets did not buy American machines -- used for liftingk pipes up to 100 tons into trenches -- they would buy from the Japanese. It said the Caterpillar consignment would not be used on the controversial natural gas pipeline project linking the Soviet Union to West Germany and France, a projectk which the Reagan administration has opposed.

As recently as Tuesday, Haig repeated his opposition to the scheme. He told a Senate trade subcommittee the administration was continuing to urge its European allies to consider alternative energy sources -- including American coal -- before financing the 3,5000-mile pipeline to transport Siberian natural gas.

However, the Caterpillar decision suggests the administration is prepared to look at trade deals on a case-by-case basis and is anxious to avoid damaging American exports by imposing any kind of blanket restriction on exports to the Soviet Union.

Last year the Carter administration granted a license to Caterpillar for the sale of 200 pipel-layers to the Soviets, but negotiations on that deal were later broken off.

Caterpillar's success in winning a license is likely to encourage othe companies anxious to trade with the Soviets, but Haig drew a line this week when he said any equipment which could help upgrade Soviet military strength would be ruled out. He told the trade subcommittee: "While clearly we have commercial interests which must and will be taken into account, security concerns must remain paramount."

The Caterpillar decision suggests the State Department's definition of what is likely to affect security is somewhat narrower than the view of the Pentagon, which is known to have argued against the pipe-laying deal.