Angela Lansbury and "Murder, She Wrote" are going out classily, as anyone could have predicted, but they're going out sassily, too. The title of the show's last episode, "Death by Demographics," is in itself something of a protest. "Murder, She Wrote" is partly a victim of commercial television's mad youth mania.

The program spent 11 of its 12 seasons in Nielsen's Top 20. Then last year, CBS programmers decided to remove it from its comfy-cozy Sunday night time slot after "60 Minutes" and exile it to Thursday nights opposite NBC's powerhouse youth-baiter "Friends." This move, which ranks with the invention of new Coke in the annals of corporate idiocy, killed the show. It plunged to 67th place. Murder most foul.

"I know that they know they made a grave error," Lansbury says now from her home in Beverly Hills, Calif. "There's perhaps no one in this country who doesn't know it was a grave error, really. They said our demographics were unsatisfactory in terms of advertising dollars, but that just wasn't the case."

Yes, Angie's still a little ticked. And saddened, as are millions of fans, by the demise of the show. She's played crime-solving mystery writer Jessica Fletcher from the beginning, in 1984, and for the past several years has been executive producer, too. She's made millions yet continued to give the impression it was a labor of love.

"I found it very difficult to get through the last episode, actually," she says. "I was very emotional about it. You know -- 12 years! It got to be like getting up in the morning. Ah well. When it's over, it's over."

It's over tonight. Not brilliant or earthshaking or trailblazing, "Murder, She Wrote" was an oasis of civility in the cold, cruel desert of network prime time. It was decent, literate and sophisticated. It had good manners.

For its last four outings, CBS moved "Murder" back to the Sunday time slot it long owned, and its ratings immediately rebounded. "Death by Demographics," at 8 tonight on Channel 9, is set at a San Francisco radio station whose format is being changed from classical to rock. The son of the station owner is opposed to the move and tells a sleazy producer, "You realize we're going to lose our entire audience." The producer's response: "Yes, and replace it with 12-to-18-year-olds, the ones who spend serious money on new products and new ideas, and the ones that advertisers pay big bucks to reach."

Lansbury is 71. "Murder, She Wrote," at 12, is the longest-running detective show in TV history. But television is no respecter of age. It's only a respecter of money.

There's a happy ending to tonight's episode (and it's spoiling nothing to tell you that), however, and it gives a veteran classical deejay played by David Ogden Stiers the chance to say, "The advertisers seem finally to have discovered the idea that people like us are an invaluable segment of the market."

No one has to read between the lines to get the message. It's right there in the lines.

Although tonight's is the last episode of "Murder, She Wrote" as a weekly series, Lansbury and Fletcher will return next year in a few two-hour movies under the "Murder, She Wrote" banner, Lansbury confirms. "CBS have not wanted to make it official yet," she says, still using her British grammar. "Don't ask me why. It's sort of stupid, really, but they've been doing all kinds of nonsense to hype the last show. They wanted to make it a big event."

That included running a purposefully misleading promo that asked, "Is this the end of Jessica Fletcher?" and featured shots of Lansbury that were not taken from the final show. A CBS spokeswoman said the scenes of Lansbury were "generic" shots from the opening credits and that the spot was therefore not misleading. Jessica Fletcher is in no real danger in tonight's show.

"We'll see however many the traffic will bear," Lansbury says when asked how many movies she'll do. "Raymond Burr was very successful with Perry Mason' movies, and Columbo' went on forever, so we'll see. I think Murder, She Wrote' can be a big night on television providing we do absolutely crackerjack stories -- which is exactly what we hope to do."

Lansbury rejects the idea that the only viewers who watched "Murder, She Wrote" were the denture and Depends set. "Yesterday a woman said to me that her daughter, who is 14, would hear our theme music and shout, Come on, Mom, let's go watch the show!' We had everybody, from 8-year-olds all the way up to 90.

"Now I find myself dealing with a public who are desperately unhappy that we're going off. I am constantly being stopped in the street by fans of the show. It was a habitual thing with so many families, and suddenly not to have it upsets them terribly."

She also hears from people angry with CBS for the way it treated the proud lady. "People sidle up to me in drugstores and say, You made CBS! How could they do that to you?' " At least we know Lansbury is approachable. But as she says, " 60 Minutes' and Murder, She Wrote' absolutely saved CBS's bacon for a number of years."

Together, they were a one-two punch that proved unbeatable, week after week. There are CBS sources who claim, however, that the network was actually losing money on every episode of "Murder, She Wrote" because production costs rise when a show runs for years and years, and the license fee CBS paid Universal for the show escalated, too. Lansbury pooh-poohs the notion. "I don't believe that," she says. "It is an expensive show. I know the costs are very high. But Roseanne' costs over a million dollars an episode, and it's a half-hour sitcom."

She estimates that this season CBS paid $1.7 million for each hour-long "Murder, She Wrote."

Even if the network lost money on the program itself, "Murder, She Wrote" proved itself a solid building block for Sunday evenings, holding on to the "60 Minutes" audience and giving the network movie that followed "Murder" a very robust lead-in. CBS owned Sunday nights for the years that "60 Minutes" and "Murder, She Wrote" were back-to-back.

Maybe "Murder, She Wrote" wasn't cutting-edge or hip, but it was darn good and it drew a big, big crowd. As for this business about demographics, the networks keep changing that rule to suit their latest programming decision. One minute they say the total number of households doesn't really matter and what counts is the demographic breakdown of the audience, and the next they say demographics are hooey and the point is to get as many people as possible into the tent.

Networks twist and torture every statistic they get their grubby little mitts on.

There are other reasons to mourn the disappearance of "Murder, She Wrote" from the weekly schedule (once the summer reruns are over, that is). It may turn out to be one of the last network dramas to sustain a single narrative over the course of an entire hour. The new breed of dramas, "ER" being the most prominent example, gives viewers multiple story lines that ebb and flow throughout the program. You're not watching an hour-long drama so much as a collection of modular snippets -- secular commercials, as it were, designed to appeal to the attention spans commercials and sound bites have encouraged.

In this it could be said that "Murder, She Wrote" was old-fashioned, but a better word would be traditional. Reruns of "Hill Street Blues," that trendy and zeitgeisty cop show of the '80s, look dated and quaint now, but in 10 years, reruns of "Murder, She Wrote" will probably play just as well as they do today. Except for superficial details such as decor and automobile styles, some of those old black-and-white "Perry Masons" hold up remarkably. A good story is a good story, and if it's told well, it stays a good story for a long, long time.

"Murder, She Wrotes" may turn out to have longer expiration dates than "NYPD Blues" or even "Friendses." Certainly the notion of a savvy old lady plunging fearlessly into crime scenes and solving riddles that stymie cops and bureaucrats will remain attractive for years, if not decades, to come. And Lansbury's flinty yet whimsical portrayal promises to wear very well. In fact, "Murder, She Wrote" reruns get very good ratings nightly on the USA Cable Network.

Lansbury has her own explanations for the show's longevity. "The mysteries were all formula stuff, there's no question about that," she says bluntly. "But the audience felt they could solve it along with me. The overwhelming response from the audience was a feeling of being very comfortable with the character of Jessica. They knew her, they trusted her, and they loved watching her unravel all these things. Women especially admired her independence, I think, and the way she handled her widowhood."

For Lansbury, the prospect of even semi-retirement is not a viable option. "No, no," she says. "I'm first and foremost just an actress. It would be very hard for me just to fold up my tent and creep away. After the first sort of down' moment" -- when it was clear the end was at hand -- "your energy suddenly rises. I said to myself, Broadway, movies, whatever, dammit, I'm going to get out there and put this bit of talent I have to work.' "

This summer, she'll be shooting "Mrs. Santa Claus," a new Jerry Herman musical for television, and then the TV movie "Mrs. 'Arris Goes to New York," a follow-up to her "Mrs. 'Arris Goes to Paris," based on the stories of Paul Gallico. A veteran of 44 motion pictures, Lansbury has played everything from the abused little nightingale in "The Picture of Dorian Gray" to a malevolent and Machiavellian monster-mama in "The Manchurian Candidate." On Broadway, of course, she scored a huge success in "Mame," the musical version of "Auntie Mame"; a snippet of the song "It's Today," from "Mame's" score, is heard under the logo for Lansbury's production company at the end of each episode.

"I'm all right. I'm hanging in," Lansbury says, though still clearly upset about her show's demise. She's not so mad at CBS that she'd dream of doing the Jessica movies for another network. "I think they're going to do right by us from now on," she says.

In a bylined article for TV Guide, Lansbury said recently that she'd like Jessica to be remembered as "an active, mature woman, possessed of courage, independence and wit, broad-minded and young at heart, a champion of the wrongly accused." Exactly. And that's why we miss her already -- even though she isn't quite gone yet. CAPTION: Over the course of 12 years of investigations, Angela Lansbury's Jessica Fletcher has crossed paths with the likes of, clockwise from top right, Peter Graves, Milton Berle, Paul Sorvino and Jerry Orbach, the last two of whom went on to become detectives in their own right on "Law & Order." CAPTION: In the pilot for "Murder, She Wrote," Arthur Hill, above, played Angela Lansbury's publisher. In a 1992 episode, Harvey Fierstein was guest star.