The D.C. City Council, faced with a serious and persistent drug problem in the nation's capital, yesterday gave final approval to a comprehensive new city narcotics code, but rejected a proposal to make jail terms mandatory for drug dealers.

The drug bill is the first of several criminal code revisions that city officials had hoped would lay the groundwork for an eventual and total transfer of prosecutorial authority from federal to local hands. But U.S. Attorney General William French Smith yesterday told Mayor Marion Barry that the generally opposes local prosecution of criminal cases.

With the passage of the drug control measure, hundreds of cases now tried in federal courts here will instead be heard in D.C. Superior Court, although still prosecuted by assistant U.S. attorneys. Supporters of the bill said it will give prosecutors more tools in the escalating war against drug dealers in Washington.

In passing the new local drug code, which is essentially patterned on the federal model already in use here, the council members rejected calls from Council Member John L. Ray (D-At-Large), Police Chief Burtell M. Jefferson and some church leaders to make the local code even stricter than the federal law by making jail terms mandatory for drug dealers.

Federal prosecutors are filing charges against drug defendants at the rate of about 300 a year, according to Principal Assistant U.S. Attorney Robert Ogren. He said "most of the felony narcotics cases and the heroin cases are prosecuted under U.S. District Court," primarily before the city lacked its own comprehensive drug laws.

Ogren said "a large proportion of those cases would be appropriate for prosecution" in the city-run D.C. Superior Court. In Superior Court, prosecutors could in some cases request use of preventive detention, the recently upheld city law that permits judges to jail suspects without bond because they are deemed too dangerous for pretrial release.

The drug bill now goes to Barry, who is expected to sign it soon, and then to Congress. It will become law in about two months, unless one house of Congress votes to disapprove it.

The council approved the bill ona 10-to-1 vote after an emotion-laden 1 1/2-hour debate that often left Ray isolated in his crusade for mandatory sentences. Ray was the lone dissenter on the final vote; Council Members Jerry A. Moore Jr. (R-At-Large) and Betty Ann Kane (D-At-Large) were out of the room at the time.

Council Member David A. Clarke (D-Ward 1), the chief sponsor of the bill, said the new narcotics code emphasizes "effectiveness, not toughness. This is a strong bill compared to what the current (District) law is."

That District law, enacted by Congress in 1938 and never significantly updated, is seldom used by prosecutors, except in misdemeanor cases. It provides penalties of up to one year in jail for the sale of any type of drug. That is why, in serious drug cases, prosecutors opt for the federal drug code.

One major difference between the federal narcotics code and the local drug bill is that the city law considers marijuana a less dangerous drug. The law provides lesser penalties for those who use it, grow it or sell it.

Under the federal law, marijuana is considered a "Schedule I" drug, in the same league as heroin and mescaline. Under the city bill, marijuana is put in the same category as the small amount of codeine in some commercial cough medicines.

The result of that one change from the federal law is that persons convicted of selling or distributing marijuana would be subject to no more than one year in jail plus a $10,000 fine. Under the federal law, marijuana sellers, like heroin dealers, are subject to a stiffer 10-year jail term plus a fine.

Under the city bill, persons conviced of selling Schedule I drugs, like heroin and LDS, face up to 15 years in jail and a $100,000 fine. That penalty is doubled if the drug has been sold to a juvenile.

The city bill also makes possession of any quantity of any drug a misdemeanor subject to a one-year jail term and a $1,000 fine. "It's a misdeamenor, and it doesn't matter what the amount," and Ray, who contended that someone caught with 500 pounds of heroin could argue that he intended to use it, not sell it.

Clarke said prosecutors and juries could take into account how much of a drug a person had in his possession when deciding whether he intended to use it personally, which would be prosecuted as a misdemeanor, or to sell it, a different, more serious charge.