On the sand of a desolate compound at the edge of the Somali capital, a grotesque scene was unfolding.

Hundreds of young Somalis, laughing and cheering, were playing war. Holding planks and sticks as if they were rifles, they went over the top like GI Joe and advanced across the hot sand toward 97 imaginary enemy. As television cameras recorded the event, they rose and charged again, shouting defiantly and yelling the Somali equivalent of bang, bang. It looked like great fun.

The foreign press corps, virtually confined to Mogadishu hundreds of miles from the real action in the Ogaden war, watched uncomfortably as yet another piece of theater was staged for the benefit.

In theory they were seeing the people of Somalia respond to the declaration for emergency and call to the colors issued by the government last weekend. But since the shouting and war-whooping began when the press arrived and the man who was supposed to be enrolling the volunteers closed his book and left when the cameras stopped filming, some doubt was expressed about the authenticity of the scene.

The seeds of that doubt had been planted the day before at an army basic training camp on the other side of town. The press, invited to visit a "mobilization center," arrived to find a line of about 200 men and women waiting to enlist.

Brandishing sticks that had apparently been issued to them only moments before, they yelled their defiance of the hated Ethopians and their Soviet and Cuban allies.

A lieunenant in a black beret was signing up the volunteers. When the cameras arrived, up stepped a young man who conveniently replied in English to the questions the lieutenant put to him in Somali.

Name, Mohammed Said Omar. Age, 18. Home, a district 100 miles away. Profession, student. Reason for joining, "to fight the imperialist." In the current language of Somalia, imperalists means the Ethopians, the Soviets and Cubans who in the Somali view are trying to hold on to land that is rightfully Somalia's but was seized by an Ethopian empire with colonial ambitions.

At another camp, which had been under development as a residential compound for the Soviet military advisers here before Somalia threw them out, the "volunteers" did not even go through the motions of lining up to enlist. They clapped and sang patriotic songs and brandished crude weapons for the press, and then dispersed.

It is a romantic notion, the people of a small, poor country going off to war with axes and spears to defend their homeland against an overwhelming stronger aggressor. There is a strong suspicion here, however, that the government, lacking the arms and aircraft it needs for the mechanized conflict developing in the Ethopian mountains, has resorted to fakery. What is not clear is whether the aim is to fool the Somali people or to fool the foreign press.

The young men who laughed as they advanced across the sand under make-believe enemy fire know nothing of modern warfare. Outsiders here find it difficult to believe that Somalia is actually planning to throw them in a cannon fodder before the advanced of the Soviet-equipped Ethopians.

They think the real purpose is to let the people of Somalia know the difficulty of the military position in which this country finds itself, and to rally sentiment that will sustain the nationalistic claim to the Ogaden even if Somalia again loses control of it in military action.

President Mohammed Siad Barre has told the people that "the territory belongs to the liberation forces who are determined to fight to the last, no matter what forces ally themselves against them."

In a speech after the mobilization was announced, he recalled a Somali saying - "It is the broom that wears out, rather than the pavement." The implication was that Somalia's historic tie to the Ogaden will survive this attempt to destroy it, as it has all others.

Military officials say that in the first two days of mobilization, there were more than 30,000 volunteers in the Mogadishu area alone. That is approximately the size of the entire Somali regular army.

Truckloads of young men speeding off to training camp can bee seen all over Mogadishu, but skepticism about the volunteers became inevitable when the enthusiastic enlistments displayed to the press were so clearly stage-managed. The mirth seemed out of keeping with the reality of the situation at a critical moment in the country's history.