HARARE, ZIMBABWE -- Sam Gozo, who runs an import-export business in this black-ruled nation just north of white-ruled South Africa, has a prayer for both the future of his country and the future of his pocketbook.

He turns to it whenever local politicians denounce "racist bullies" in Pretoria and demand that Zimbabwe impose economic sanctions.

"I pray to the Almighty that the political rhetoric of breaking ourselves from South Africa stops at rhetoric," said Gozo.

Thus far, despite impassioned speeches in favor of sanctions by Zimbabwe's president and other politicians, Gozo's prayer has been answered.

In the past 18 months, when push has come to shove with Pretoria, Zimbabwe has bowed to the bottom-line interests of businessmen like Gozo and backed away from threats to cut trade links with South Africa.

Zimbabwe's climb-down on sanctions is the most visible component in the painful evolution in the way Africa's youngest nation -- which until eight years ago had its own white-minority government -- has chosen to deal with its powerful neighbor to the south.

"We hate the South Africans. But there is no way we can stop trading with them," said Dumiso Dabengwa, a well-known guerrilla leader in the civil war that saw 27,000 people die to free what was then Rhodesia from white rule. Dabengwa now runs a company that imports spare parts for cars and the mining industry via South Africa. "We just can't afford sanctions. We are a developing country."

Like other landlocked nations in southern Africa, Zimbabwe's economic lifeblood flows through South Africa. About 70 percent of this country's foreign trade moves by road or rail to South African ports. South Africa is Zimbabwe's largest trading partner, buying about 18 percent of this country's exports and supplying about 20 percent of its imports.

Yet, unlike the other "front-line states" that exist in the economic and military shadow of Pretoria, Zimbabwe is not an economic or military invalid. It has one of the most sophisticated industrial and agricultural infrastructures in black Africa. It has the proven capacity to feed itself and export cash crops despite severe drought. It also has an experienced 50,000-man Army. On a continent where independence often has been a prelude to penury, Zimbabwe is a relatively prosperous nation with a future.

Zimbabwe's combination of vigor and vulnerability places it in a pivotal but precarious position in southern Africa. Among its black-ruled neighbors, it is the richest and toughest kid on the block -- the natural regional leader in the struggle of black South Africans to overthrow the system of racial segregation known as apartheid.

But with its enormous potential, Zimbabwe also has the most to lose among the front-line states if it were to push Pretoria too far. Western diplomats and local businessmen here said countersanctions by South Africa, especially a sudden closure of transport routes, could cripple Zimbabwe and perhaps deliver an irreparable blow to its export-driven economy.

"This country could be the Switzerland of the region," said businessman Gozo. "What pains my heart is that our leaders, by trying to show total disgust of the apartheid system, may be leading us toward disaster."

The evolution of Zimbabwe's policies toward South Africa suggests that the country's leadership, even as it continues to denounce South Africa, has come to share Gozo's fear.

A case in point is the reluctant education of Robert Mugabe, the former guerrilla leader who is now president of Zimbabwe. Among leaders of the front-line states, Mugabe has been by far the most strident in calling for punitive sanctions. Five times in the past 18 months he has vowed that Zimbabwe would implement them, and the consequences be damned.

According to his speeches and a number of people who are in contact with him, Mugabe feels morally obligated to help liberate the black majority in South Africa. That obligation is said to derive, in large measure, from the assistance he received from neighboring black states, especially Mozambique, during the civil war that swept whites out of power in this country.

"Mugabe is a man of principle. It bothers him, it eats at him that Zimbabwe is not doing everything it can to isolate South Africa," said one senior western diplomat here.

In mid-1986, Mugabe returned from a meeting of Commonwealth nations in London and announced that Zimbabwe was ready to join several non-African nations in imposing sanctions on South Africa. The sanctions would have severed all air links and banned imports of steel and coking coal. Mugabe also said he would scrap a trade agreement with Pretoria that makes Zimbabwe's goods competitive in the South African market.

"Our nation will be called upon to endure hardship . . . let each and every one make noble sacrifices," Mugabe said. "If we have to eat sadza {maize meal} without stew, we will do it."

After talking over these sanctions with business leaders here, Mugabe learned that the national airline needed the lucrative South African route to pay for three newly purchased Boeing 737 aircraft. He learned that his country had no cost-effective way of making steel without South African coking coal and that the state-owned steel company, Zimbabwe's single largest employer, would be forced to close. He also found out that the trade agreement with Pretoria was essential to the profitability of several local manufacturers.

"Mugabe found himself out front without the ball on sanctions. The game was behind him. None of the other front-line states was willing to play," said a business leader here who meets regularly with the president.

The "noble sacrifices" were never implemented. Last August, Mugabe tried again to go it alone. His government told business executives that import licenses would not be granted for goods purchased in South Africa. But after howls from the business community, that sanction, too, was shelved.

The lessons of these embarrassing retreats, which were gleefully publicized in the South African press, appear not to have been lost on Mugabe. In his article entitled "Struggle for Southern Africa" in the current issue of Foreign Affairs, Mugabe writes:

"It became clear that some front-line states are not able to impose sanctions because their economies are tied into the South African economy like Siamese twins."

In his article, Mugabe pointed to a new sanction strategy for the front-line states.

"Although unable to do so themselves they urge those who can -- especially the big powers -- to adopt sanctions."

While it has pulled back from any direct economic or military confrontation with South Africa, Mugabe's government has not caved in to South African regional dominance.

It has taken the lead among front-line states in pushing to reduce regional transport dependence on South Africa. Over the past three years, according to western diplomats, Zimbabwe has committed up to 12,000 troops at an annual cost of about $300 million to guard transport lines through Mozambique. These troops also have helped Mozambique's beleaguered Army to fight the South African-backed rebel group Renamo.

Using the refurbished and heavily guarded "Beira corridor" road and rail lines that cut east from here across Mozambique to the Indian Ocean port of Beira, Zimbabwe has cut its reliance on South African trade routes substantially.

In the past four years, the percentage of this country's trade that passes through South Africa has fallen from about 95 percent to about 70 percent, according to Eddie Cross, managing director in Harare of the nine-nation coordinating committee that is pushing to find alternative transport routes for the front-line states.

The price of guarding the transport routes and fighting Renamo has been and is likely to remain high. Cross estimated that the annual cost of Zimbabwe's armed presence in Mozambique equals about 2 percent of the gross national product. In addition, Renamo last year formally declared war on Zimbabwe and has begun a damaging series of cross-border raids, robbing stores, destroying farms and killing civilians.

Many of the same local business leaders who objected to Mugabe's sanction threats are now complaining about the cost of maintaining troops in Mozambique. These business leaders said the war could not come at a worse time for Zimbabwe's economic development. They pointed to a debt burden that devours 35 percent of national earnings, a chronic shortage of foreign exchange for spare parts and growing unemployment.

"In terms of common logic, the war is a disaster," said Gozo. "But you try to argue with a minister and he will say it is a political decision."

Mugabe, however, having grudgingly given up on direct confrontation with South Africa, appears unlikely to back down in Mozambique against rebels who are viewed here as proxies of Pretoria. Last fall, he vowed to "fight to the last man" to prevent a rebel takeover in Maputo.