Josiah Moeng, stocky and straightforward, admits he gets a lot of flak from his friends about his job.

"Maybe they're jealous," the 30-year-old, eighth-grade graduate said. Besides an annual salary of at least $2,070, Moeng enjoys on-the-job training, promotion opportunities, free uniforms, medical and dental care, a 30-day annual vacation and a guaranteed pension when he retires at 60.

This is the kind of job most of South Africa's 18 million blacks can only dream about in a labor force where urban unemployment is estimated at between 16 and 22 percent.

But on further questioning, Moeng, who is a career soldier in the South African Army, says that his friends' criticism is also political.

"They say we are fools, they think we have joined a white army," Moeng said. "But that's not ture, the Army was declared white at one time, but now it's multiracial."

The South African Army is a long way from being multiracial, but an important and controversial change is quietly taking place. If the defense chiefs have their way, Moeng will be among thousands of black soldiers serving in all-black combatant units of South Africa's regular Army in the next several years.

At the moment, his 21st Battalion of 515 volunteers, is the only one in a career force of about 10,000 men. At least four other battalion-strength units are planned for the initial stages of the buildup of black units, according to military sources. They decline to disclose the specific targets for black participation in the defense force. It now stands at 1.3 percent.

There are also six battalions of black volunteers serving in Namibia (Southwest Africa) in what is scheduled to become a separate army at the end of this year.

The elevation of blacks to full combatant status has been a policy gradually gaining acceptance since the early 1970s under the initative of Prime Minister Pieter W. Botha, who is also in his 13th year as minister of defense. Before that, black volunteers were relegated to noncombat jobs.

In recent months, however, there are signs the change in policy has become a priority as part of South Africa's increasing military preparedness-described by one local magazine as "digging in for the 'White Man's Last Stand."

A record military budget of $2.1 billion for this year, 25 percent more than last year, and the highest white draft (15,000 last January) since World War II also reflect the military's intensified contingency planning. The new planning comes amid changes in neighboring Namibia and Rhodesia, where blacks make up a majority of the Army, threaten to denude South Africa of its last two guaranteed "buffers" between it and black-ruled Africa.

A rapidly escalating guerrilla war on the country's northeastern borders when the Rhodesian conflict is over is one of the military's main concerns.

In addition, the military also appears to be preparing for a continued major role in Namibia, given the conviction shared by both military and political leaders here that the United Nations' peace initiative, even if it is carried out, will not end the Soviet-backed gurrilla war there. The six black battalions in Namibia, which are now part of the South African Defense Force, are intended as a basis for a separate Namibian national army once that territory achieves independence.

By increasing black participation in their armed forces, the South Africans are taking a leaf from the defense handbook of their white neighbors in Rhodesia, where the security forces have been more than 80 percent black for several years.

The scarcity of job opportunities, especially in rural areas, leads increasing numbers of blacks to join the army. The unemployment problem, and laws that make it a crime to discourage participation in the defense force, make it difficult for black leaders who oppose the government's racially discriminatory policy of apartheid to speak out against a trend they deplore.

But they do. An alliance of political parities, chaired by Zulu Chief Gatsha Buthelezi, declared last July: "While blacks do not enjoy citizenship nor share political power, it [the alliance] will not argue the black community to participate in the military defense of the apartheid regime."

Their stand spotlights what one military officer confessed was "reasonably delicate problem" in recruitment of blacks into the defense forces: Under present government policy, black South Africans will eventually lose their citizenship in South Africa to become citizens of one of 10 black homelands destined to become "independent" black states.

Technically, therefore, South Africa's blacks will become "foreigners" in what remains of white-controlled South Africa.

Rear Adm. Ronnie Edwards, who heads personnel in the defense force, has a ready answer for the contradiction.

"Every black is potentially a citizen of another country. Then all blacks will belong to an individual state, which means the 21st Battalion will be a foreign legion."

"They expect us to be 'patriotic' foreigners" complained Buthelezi in a recent speech. "We are called upon to offer our lives in defense of the borders of a country in which we will now be foreigners. . . I have never seen such insensitivity in my whole life."

Most blacks, even those with little involvement in politics, have no intention of giving up their citizenship in South Africa. A random sounding of members of the 21st Battalion reveals a discrepancy between their expectations and those voiced by Edwards.

"We consider ourselves to be South African citizens," said Riebert Khoza, 25, during a cigarette break in a lesson on mortar firing. "And we expect in five years time to still be," he added as his classmates, all training to become black instructors for new black recruits, nodded in agreement.

Many of those questioned also added that they would fight what they called "infiltrators" and "terrorists" who try to come across the border, reflecting the thinking of their unit commander.

"Our enemies would like the world to believe that this is a black-white struggle here, but it's not . . .," said commander Hennie Swanepoel. "The onslaught is not aimed at the white man as such. It's aimed at all the people."

The Afrikaner officer said that like many other whites, he used to oppose training blacks to use firearms.

"But I have completely changed my attitude, he said. "I don't say this is our only option, but I do believe we must introduce them to a greater degree into the defense force because of the nature of the struggle."

Black soldiers are trained at Lenz, 22 miles southwest of Johannesburg where they can be seen clambering over obstacle courses and learning to march. Their instructors are white.

We are training blacks for an unconventional war, a terrorist war," said Swanepoel as he took a visitor around the base. Already members of the 21st who are billeted at Lenz have done stints in Namibia, fighting guerrillas of the black nationalist movement, the Southwest Africa People's Organization.

According to the military spokesman, about 20 percent of South Africa's manpower in the Namibian "operational area" is black or colored (mixed race). Black soldiers get the same rations, accommodation and "danger pay" as the whites, although their basic salary remains only 60 percent of what their white counterparts earn. Military officials say the government is committed to gradually closing that wage gap.

Even greater participation in the armed forces is planned for coloreds and Indians. Compulsory two-year military service, like that for whites, is expected in five years' time, military spokesmen say.

The intergation of these groups into the defense force, however, does not hold the same contradictions as that of the blacks, since the government hopes eventually to share a modicum of political power with coloreds and Indians at the national level. It does not envisage such a development with blacks. CAPTION: Picture, New recruits drill during training for the South African Army's all-black 21st Battalion. Whites are gradually accepting the idea of blacks bearing arms. By Caryle Murphy-The Washington Post