JOHANNESBURG -- Two and a half months after the South African government agreed to repatriate 40,000 political exiles and grant them pardons, Mohammed Dangor sits in his cramped office in a Johannesburg skyscraper and contemplates the nightmarish task ahead of him.

Dangor, a trained business administrator, heads a committee of 21 representatives of the African National Congress, the Pan-Africanist Congress and the Black Consciousness Movement -- rival black nationalist groups -- as well as Christian, Moslem and Jewish religious organizations, coordinating the massive operation of bringing the exiles home.

Before next April, he must organize the return of these exiles from 35 countries to a nation where the policies of racial separation that spurred them to activism and forced them into exile are falling away, but where joblessness and homelessness afflict millions of people.

So far, he has only enough money to provide 85 returning exiles with the bare necessities.

"We are going to have to tread a very narrow line between obligation and resentment," Dangor reflected. "On the one hand, we owe it to these people to help them. On the other hand, we must be sensitive to the feelings of people here at home who are unemployed, or have been on the waiting list for houses for years and who are going to resent it if the exiles jump the queue."

Disagreements over the amnesty between the ANC, which demanded the repatriation, and the South African government are making Dangor's task more daunting, and have put the program behind schedule.

The government and the ANC agreed on the terms for a general amnesty but now dispute its interpretation. The ANC says it was agreed that people would be cleared by categories and it has submitted the first 3,000 names. But the government is insisting that each exile must state where and how he left the country and list the political "crimes" he wishes to be pardoned for.

The ANC refuses to subject its members to what it considers tantamount to an interrogation and a confession. So the 3,000, who who were expected to start coming home this month, are still waiting in Tanzania, Zambia and Zimbabwe.

Under a plan formulated by Dangor's committee, reception centers would be established so that returnees would have a few days' accommodations while they sorted out their legal problems and contacted relatives.

From there they would be expected to go to their hometowns and villages. Those who had no relatives or homes, or were disabled, would be transferred to secondary reception centers where they would have more time to sort out their problems.

"But even that can only be a matter of a few days," Dangor said. "We don't want to become a charitable institution. Nor are we going to become a development agency. Helping the people get settled is . . . the responsibility of the liberation movements."

The ANC would like to pay its returnees a stipend plus a rent allowance of about $550 a month for three months, together with a lump sum of $2,500 for basic furnishings, according to Jackie Selebi, the group's head of repatriation. But that would mean a second budget of $100 million just for the ANC people.

"It's clearly beyond our ability, yet we must do something. We are talking to government, to businesses, to international agencies. Our people must come home with dignity," Selebi said.

Dangor estimated that his program needs a minimum of $56 million. He has $120,000 on hand, with pledges for $4.5 million more.

"Hopefully we are going to pull this thing off, but I don't know how," he said.

In numerical terms, the task is smaller than that faced by neighboring Zimbabwe, which had to resettle 125,000 exiles and 66,000 former guerrillas after its long, bitter civil war against the nation's white-minority regime. Namibia had to bring home 50,000 last year.

South Africa's figure of 40,000 does not include an undisclosed number of guerrillas of the ANC's military wing, who are not coming home yet.

But while the experienced staff of the United Nations High Commissioner for Refugees handled the Zimbabwean and Namibian repatriations, the South African government refuses to allow it to do so here.

Pretoria objects to any outside organization becoming involved in South African affairs, and has been extremely critical of the United Nations because of its decades-long role in internationally isolating South Africa in an effort to make Pretoria drop its policy of racial separation, or apartheid.

The result is that the task must be handled by the black political organizations themselves. Thomas Nkobi, the ANC's treasurer general, said the government has done nothing to help the groups, even though it agreed last May, when the government and the ANC held their first power-sharing discussions, that it had a responsibility to assist with the relocations.

"They say they are aware of the problem, but that the government is broke because of {economic} sanctions" imposed by other nations, Nkobi said. "Our contention is that in spite of the financial crisis they have, it is part of their responsibility."

Dangor went further, accusing the government of bad faith. He said that when his committee learned that a government housing development with 106 apartments was standing vacant, "we wrote asking if we could use it as a reception center, but got a letter back saying it was to be sold."

Even if the exiles' initial needs are provided for, they still face the problem of finding permanent housing and jobs. South Africa's unemployment rate is 30 percent and rising, and with the recent abolition of the apartheid system's controls on free movement, the nation has the world's fastest urbanization rate. Millions stream from the desperately poor and overcrowded tribal "homelands" to settle in squatter camps in and around South Africa's cities.

The government has given up trying to provide housing for everyone, agreeing instead to legalize "controlled squatting" on specified sites where only water taps and pit toilets are provided. People must spend years on a waiting list to get one of these sites.

"We will have to do a lot of explaining," said Selebi. "We must explain to the exiles that they can't all expect houses, and we must prepare the people at home politically to welcome the returnees. It will be a sorry day if those who left to continue the struggle outside are not well received back home."

Meanwhile, lists of returnees are being circulated to prospective employers. "Those with qualifications will be okay, but the unskilled and semi-skilled are going to have problems," said Dangor.

The ANC would like to launch programs to train returnees as builders, plumbers and electricians so it can start its own housing projects, but it seeks the government's cooperation. According to Selebi, there has been no response.