When Miss Ellie had her mastectomy on "Dallas," half the nation tuned in. It was the third largest audience share of the year, bested only by "Jaws" and the final game of the World Series.

It's not surprising. Even on an average night, some 33 million people watch the continuing spectacle of human misery, lust, rapacity and revenge that is "Dallas."

The squalid chronicle of the Ewing family is played out amid a welter of fast cars, flashy clothers, big business and big appetites. Ample footage is given to the pampered flesh of the female stars -- often displayed in aristocratic ease by pool or bedside, living incarnations of Neiman-Marcus or Elizabeth Arden -- who jiggle and sashay their way through a mind-boggling series of social and sexual permutations.

It goes like this: The central character is J. R., the son of "Miss Ellie" and Jock Ewing, super-rich owners of the vast Southfork estate. J. R. is president of Ewing Oil and married to Sue Ellen -- a former Miss Texas who slept with Cliff Barnes, J. R.'s arch rival, and then started to drink heavily. She says she doesn't know who is the father of J. R. III. (She was in a car crash just before the baby's birth.) If Cliff is the father, the baby may carry the dread Barnes family disease, in which case he may die in a year.

Cliff's sister, Pamela, is married to J. R.'s brother Bobby. She gets pregnant and wants to have an abortion, but Bobby -- who doesn't know she carries the disease -- convinces her to have the child. She falls off a horse and miscarries. Meanwhile, J. R. is involved with Christin, his wife's 20-year-old sister, a relationship known to Sue Ellen and sanctioned by Christin's mother.

And there's more: Ray, Jock's ranch foreman, has had an affair with Lucy (Jock and Ellie's granddaughter by their long-departed son Gary). Ray apparently has also been friendly with Sue Ellen and with Pamela, as well as a host of non-Ewings.

That's life as usual on television's only current prime-time soap opera. It has a powerful grasp on the American psyche. "Dallas" ranked an impressive 10th for the first 16 weeks of the 1979 season, and it's the only top-rated program on what is often the lowest-rated viewing night of the week. A nielsen spokesman calls its time slot -- 10 p.m. Friday -- "the pits."

But it works. Says "Dallas" producer Leonard Katzman, "Its appeal is voyeurism. We have an audience that likes to sit back and fantasize about what they'd do if they were wealthy, beautiful and greedy." As a result, on an average Friday evening, 23.4 percent of the television homes in America -- and 40 percent of the sets acturally turned on at that time -- are tuned to "Dallas." By comparison, the figures for No.-1-rated "60 Minutes" are 27.9 percent and 45 percent.

In fact, J. R. and company are so popular that this Thursday, CBS is starting a prime-time spin-off of "Dallas" called "Knots Landing," set in Southern California.

"Dallas," which began in March, 1978, is America's first hit prime-time soap opera since ABC's "Peyton Place" finished a five-year run in 1969. "In form, "Dallas' is very much similar to 'peyton Place,'" says bud grant, CBS vice president of programs and the man who put "Dallas" on the air. "I don't look on this as a regression. The audience loves it and can't get enough of it."

Why are so many viewers fascinated, even addicted? The answers reveal much about America's viewing habits -- and about the mentality that guides major broadcast decisions.

"'Dallas' is a hit," says Jason Bonderoff, Daylight TV editor, "because this is the first generation that's grown up on soap operas. Watching soaps is no longer a lower-class thing for bored housewives to do. It's not a negative thing. This generation is much more open-minded."

San Francisco State College media expert Arthur Asa Berger sees the "Me Decade" at work: "Life is so much like soap operas now, with things like divorce, incest and illicit affairs. We're also prisoners of psychology. The focus is on yourself and your relationships, not broader questions. The media reflect and reinforce this."

The character most responsible for the success of "Dallas" is J. R., the man America loves to hate. Says "Dallas" creator David Jacobs, "The first actor we talked to about playing J. R. said he wanted to understand the character better, and after a while I realized that he wanted J. R. cleaned up a bit. I thought that was wrong. If the show was to be a hit, we'd need the evilist, baddest type of guy for the central character. Bigger and badder than life." The second actor interviewed -- Larry Hagman, famous for playing the clean-cut hero on "I Dream of Jeanie" -- got the job.

"He never really looks evil," Katzman explains. "He's charming and pleasant and he smiles. He plays against what he's doing."

Sociologist Berger suggests that "there's frequently a pay-off from such a strong and interesting villian. Comic books and popular fiction frequently do this. For example, Dr. No. was very interesting, perhaps even more than James Bond." The J. R. character, he says, "provides the audience with guilt-free aggression. Most of us have hostile impulses and can't find a good way of getting rid of them."

According to producer Katzman, the actors never have to be reminded to be evil. "They take great enjoyment out of playing the roles as written," he says. "Nobody wants to fool with success."

Despite its awesome success, "Dallas" -- like so many events in the broadcast industry -- happened virtually by accident.

The show's creator, David Jacobs, 44, is a self-proclaimed "former legitimate nonfiction writer" who wrote American Heritage books, a survey of Renaissance painting for teen-agers, and articles on architecture for The New York Times magazine.

He's always been interested in "marriage, divorce or engaged people," and his own life might make a good TV pilot. In the mid-1970s, Jacobs and his wife were divorced, and she moved with their daughter from New York to California. "I was very close to my daughter, so I moved out, too," Jacobs says. His ex-wife married an actor. Jacobs himself remarried and eventually hired his ex-wife's husban to be a regular on "Dallas." The deal was easy to consummate because Jacobs' ex-wife is her husband's agent.

Upon his arrival in Hollywood in 1976, a book he'd written on the New York City police landed Jacobs a job writing for "The Blue Knight" series, which failed after four weeks later. Next he worked as story editor for "Family," but Jacobs needed "characters who are my own," so he began to generate program ideas. His "Marriage the First Year" aired as a four-part CBS pilot but went no further. He then developed an idea he describes as "'Scees From a Marriage' times four" and took it to the network.

CBS turned him down. "The development people said they wanted something rich instead of middle class," Jacobs explains. "They said, 'Give us something larger than life and put it in the Southwest somewhere.'"

Jacobs asked no questions, figuring that the movie "Giant" (about rich people in the Southwest" had done well, and That "TV was moving away from cops and violence shows. They were digging around for something that would be a little fresh and a little sexy."

He returned with "Dallas." Less than a month later, in November 1977, CBS responded. "We bought it right off the script," says CBS Bud Grant. Taking a risk, Grant ordered five episodes instead of a pilot. "Dallas" looked too good to wait for. Four months later, it was on the air.

As for the name, Grant says he "could sound very wise" if he claimed credit, but it belongs to Jacobs.

"It was something I worked on for maybe 15 or 20 minutes," Jacobs says. "I'd scarcely ever been in Texas before I started the project. 'Dallas' sounded good. It had won the Superbowl that year, and it had the Kennedy assasination behind it. It was opulent and decadent. You never think of a cowboy going into Houston, but you think of them going into Dallas."

Another measure of success is the speed with which the show's spin-off is appearing. The ever-powerful "All in the Family" and "Mary Tyler Moore Show" took years to produce progeny, but "Dallas" required less than two full seasons. However, there is little connection between "Dallas" and "Knots Landing." And for good reason: "Landing" is the Jacobs' project that CBS rejected in the first place. As originally conceived, it has nothing to do with Texas, oil or the ewings.

"One 'Dallas' is enough," says Jacobs. "'knot's Landing' will be a whole new type of show. It depicts four very different married couples. We take a problem, incident or event and show how all four couples handle it, and how it affects their interaction."

To establish the Dallas connection, Jacobs removed one of the original couples and substituted J. R.'s long-missing brother Gary Ewing and his wife, Valene; parents of Lucy (who continually fights with J. R. and plans to marry someone who told him off in public, but who is really after her money, and, besides, is a Ewing family double-agent).

Brother, Gary has been missing for 17 years, except for a two-part episode last year when he reappeared, only to be driven off by J. R. To lay the groundwork for "Landing," Gary and Valene starred recently in an emotional two-hour special "Dallas" in which they remarried and promptly left for sunny California to escape J. R. It's more reality-based," Jacobs says. "While 'Dallas' people represent the rich and corrupt, 'Landing' people respresent us."

Half a continent, however, cannot keep the "Dallas" relatives from visiting. In the second episide -- to be broadcast this January -- bad guy J. R. himself flies out to promote off-shore oil drilling that threatens the "Knots Landing" beach. A few episodes later, Lucy arrives.

Of the "Dallas"/"Landing" relationship, CBS' Grant says, "The important thing is to do a spin-off when it's hot. It's very difficult now for brand-new shows to succeed. Familiarity gives us a leg up."

Jacobs got the idea for a serialized show from network miniseries -- such as "Rich Man, Poor Man" and "Roots" -- demonstrated the public's nighttime willingness to follow a continuing story. PBS, with programs like "Upstairs, Downstairs," proved the same thing. And although "Knots Landing " will begin as a "series" -- in which each episode is a complete story -- Grant says it may soon follow the soap-opera format of "Dallas."

"Initially it will be episodic and not serialized," he explains. "We don't want to challenge the audience too much. We want to get them hooked, and then we'll stretch out the story line."

Daylight TV's editor Bonderoff thinks "Dallas" and "Knots Landing" may be the wave of the future.

"It's just another influence of daytime soaps," he says. "This has been coming a little bit at a time. There have been nighttime soaps for longer than people realize. We call them situation comedies, but it's just a difference in words. On shows like 'M*a*s*h' and 'The Waltons' and 'Mary Tyler Moore,' character development was more important than plot." The key is that each night's programs will have decreasingly defined beginnings, middles and ends.

CBS's Grant, who once was that network's vice president of daytime and children's programming, says, "We're not going to milk this (soap-opera serialization) to the point of losing its impact. Now we'll have two hours a week of such shows. Maybe we'll go three, but that's all." But he says, "Typically, one network does something successful, and the other two follow. The other networks must have their 'Dallas' in development."

"The networks," says Susan Harris, creator and writer for "Soap," have felt that audiences like to be left with a feeling of completion. There's no need for this. To be kept dangling week after week has always worked." Marcia Carsey, ABC Entertainment's vice president/prime-time series, says, "The 'soap' is a viable genre and we have every intention of pursuing it in a dramatic format." And an NBC spokesman says his network is planning two programs "with the kind-of continuing story line" -- "From Here to Eternity" and "United States." The latter was created by Larry Gelbart, orginator of "M*A*S*H."

Whatever happens, Jacobs has already sent CBS his next idea. It's about high school kids in a small Midwestern town and is called "Heartland High." He promises that absolutely no Ewing children will attend.