The Panama Canal treaty was conceived in riots, nurtured in hailstorms of rhetoric and born amid political sniping from all sides. Its uncertain future seems only to continue the checkered past of U.S.-Panamanian relations.

"I took the Canal Zone," bragged Theodore Roosevelt a few years after the canal opened in 1914. In those days it was still red-bloodedly American to make little countries jump to America's tune, and Roosevelt was only confirming the American self-image.

Teddy Roosevelt actually created Panama. The saga of the 11 years of constructing the canal through some of the world's most brutal jungle became so much a part of American folklore that it was easy to forget that the canal was in another country.

The taking of Panama was the easy part. Around the turn of the century, a French firm was going bankrupt trying to build a canal through what was then a minor province of northern Colombia. The company's new chief, Phillippe Bunau-Varilla, figured out a deal by which the United States would buy out the worthless French claim to the Panama route for $40 million and toss in $10 million to Colombia for the right to build.

He convinced Roosevelt, but the Colombian government wasn't interested.

"History would say of me . . . that I ruined the Isthmus . . . scandalously injuring the rights of my country," wrote Colombia's then-President Jose Manuel Marroquin.

Incensed, Roosevelt acted. Bunau Varilla's wife designed and sewed a flag for a new country, and Bunau Varilla gave the flag, a draft constitution, a declaration of independence and some money to a Panamanian doctor, Manuel Amador. On Nov. 3, 1903, Amador was one of the leaders as the province of Panama rose in reballion against Colombia.

U.S. vessels had orders to keep Colombian troops from landing within 50 miles, and the U.S.-run train refused to transport them. On Nov. 6, Washington recognized Panama as a new nation and then received Panama's new special ambassador, Philippe Bunau-Varilla.

On Nov. 18, two weeks and one day after the rebellion, the Panama Canal treaty was signed. It gave the United States control over a 10-mile wide zone bisecting Panama "in perpetuity . . . [with] all the rights, powers and authority which the United States would possess and exercise if it were the sovereign of the territory . . . to the entire exclusion of the exercise by the Republic of Panama of any such sovereign rights, power of authority."

The Hay-Bunau treaty, observed Secretary of State John Hay, was "vastly advantageous to the United States, and, we must confess, not so advantageous to Panama."

Construction began.The idea was to dam the Chagres River to create a manmade lake reaching the ankles of the mountain spine of the isthmus, dig an eight-mile ditch through that spine, and build locks on either end to raise and lower ships 85 feet to the lake. It was to be an enterprise worthy of the pharoahs - the biggest ear then dam in the world, the largest man-made lake (Gatun Lake), the world's biggest locks by far and the largest excavation ditch in history.

All this amid baffling and complex geology, rampant malaria and yellow fever that had defeated the French, in a country with virtually no skilled labor, no housing or medical facilities to speak of, and a population smaller than the necessary work force - and at the hesitant dawn of the electrical age even in developed areas.

"It was themoon shot of the day," observed former Canal Zone Gov. David S. Parker, "but it was on the public consciousness in the United States for almost 10 years and a continuing topic of converation for decades."

The job cost $387 million, but its real toll was the 32,225 persons who died of accidents and disease during the cana's construction. The peak work force was 44,000 men, in 1913, 99 per cent of them non-Panamanians.

It is a measure of the engineering technology that most of the equipment at the canal when the S.S. Ancon made the first official transit through Aug. 15, 1914, is still there today. The canal is monotonously reliable in moving 32 ships a day over the 50-mile route. In 73 years there have been only four sinkings, none within the canal proper, no sabotage whatever and only two fare increases, the first in 1974.

Many of the descendants of the Americans at work in the zone the day the canal opened are still there today. The Zonians relate the canal construction story with the reverence due an historic family achievement. Panamanians have been a marginal note in the Zonians' view of history, forever relegated beyond the suburban-style houses into poverty-ridden Panama proper and excluded from most higher-paying, high-responsibility jobs in the Zone.

The Panamanians have not earned much more, in the Zonians' view. But Panamanian resentment ebbed and flowed over the years as the canal's importance waxed and waned.

During World War II some 24 million tons of military supplies passed through, saving, like every shipment, 8,000 miles and about 30 days' time over the Cape Horn route. Since then, however, a two-ocean fleet has reduced military need, while the mamoth size of supertankers and big battleships has made the canal unusable by more than 1,300 vessels worldwide.

In 1964, shortly before the peak of canal use was reached, Panama erupted into bloody riots over the issue of the flying of the Panamanian flag in the Canal Zone. Four Americans and 20 Panamanians were killed and another 80 persons were injured. President Johnson then opened negotiations with Panama on a new canal treaty.

There have been many hesitation sice then: A 1967 agreement felt through when Gen. Omar Torrijon took power in a bloodless coup and rejected the draft.

Torrijos converted the dragging treaty talks into the cornerstone of his promises for Panama's future. He prodded nationalist sentiment to his support at home and in the wakening ranks of developing countries world wide. He used the vision of a profitable new treaty to pacify critics of his moderately statist economic policies and clothed it in anti-American rhetoric to stave off leftist charges that he was proposed up by Wall Street.

In 1973 the United States used in United Nations Security Council [WORD ILLEGIBLE] for only the third time to defeat a revolution supporting Torrijos' position.

Perhaps facing the inevitable, Secretary of State Henry A. Kissinger then signed an eight-point "statement of understanding" with Panamanian Foreign Minister Juan A. Tack in February 1974.

That formed the first solid base for the eventual agreement, affirming that there would be a new treaty, that it would eliminate the notion of perpetual U.S. rights and that Panama would assume total responsibility for operating the canal when the new pact expires.

Talks proceeded on that basis despite the sideshow of rhetoric, demonstrations and the U.S. election campaign of 1976. The new treaty is the result.