Bernie Orenstein, writer and producer of "That Girl," "Sanford and Son" and "What's Happening!!", has died at the age of 95.

He and his longtime partner, Saul Turteltaub, also worked on "Kate & Allie" and a comedy starring Elliott Gould, Nathan Lane and Jackie Mason.

Bernie Orenstein is a Canadian writer and producer who has worked on sitcoms such as That Girl, Sanford, and What Happens to the Boy. More than half a century on television, Kate and Ally died on September 14, her family announced. He was 95.

Orenstein achieved his first major success in the 1960s during a three-year stint as a writer on ABC's The Hollywood Palace, and shortly thereafter he first collaborated with Saul Turteltaub. They were partners for more than 30 years — even if they rarely worked in the same room together — as one of television's most enduring comedy teams ever.

"I'd write one act, [Turteltaub] would write another act, and we'd put it together and make sure they fit. Often he'd write a whole script and I'd write a whole script," Orenstein said in a 2016 interview with Adrienne Failas for the Television Academy Foundation website The Interviews. But we never wrote together, one of us walking behind the typewriter and the other walking behind him, rattling off lines, like most comedy writers.

Orenstein said he learned a lot about comedy from Carl Reiner, who hired him and Turteltaub for the 1971-1974 CBS sitcom The New Dick Van Dyke Show.

She and Turteltaub began writing episodes of That Girl in 1967 for its first season and served as writers and producers for ABC's pioneering feminist comedy for its final two years. (Orenstein said they hurt the show's ratings by getting Marlow Thomas' Anne-Marie engaged to her longtime boyfriend, Ted. Donald Hollinger Bessel.)

They did the same thing after joining CBS' Kate and Allie in 1988 and marrying Susan St. James' character. "With her marriage, we made sure it was the final chapter, the lesson we had to learn about 'That Girl,'" Orenstein said.

The two came on as producer-writers in 1974 for the fourth season of Red Fox starring Sanford and Son (created by Bud Yurkin and Norman Lear) and remained until the end of the sitcom in 1977.

They had partnered with Yurkin, who had recently split from Lear, to launch TOY Productions, and the new company released three comedies on ABC: What's Happening!! , revolves around black teenagers growing up in Watts. Carter Country, with Victor French and Ken Holliday as small-town cops. and 13 Queens Boulevard starring Eileen Brennan.

Orenstein and Turteltaub also wrote and produced Love, American Style and Baby Talk starring Scott Baio, both for ABC. Created CBS' E/R starring Elliott Gould and George Clooney. and wrote for NBC's One of the Boys, which starred Mickey Rooney alongside Dana Carvey and Nathan Lane. NBC's You Again?, with Jack Klugman and John Stamos; and Cosby from CBS.

They also created Chicken Soup, a 1989 ABC sitcom starring Jackie Mason and Lynn Redgrave that, to Orenstein's disappointment, was canceled after seven episodes, despite the blockbuster Roseanne starring.

On that show, Mason's character was "dating a tall, Irish redhead [Redgrave]. He was a short Jewish boy." I am a short Jewish boy. "My wife [actress Barbara Rhodes, Orenstein's wife] is a tall, Irish redhead." "I said, 'Great, I know we can do anything!'" he explained.

"But no one could believe that he was the least bit interested in someone like Jackie Mason, who he played on the show. It was a failure. It was my fault. I was confident that my life would be accepted by America. Apparently it wasn't."

The youngest of five sons, Bernard Orenstein ("we were poor for it," he joked, "he had no middle name") was born on February 5, 1931, in Toronto. His father sold women's clothes and had a gambling problem, and his mother was a housewife.

As a youth, Orenstein appeared on CBC radio shows, then after dropping out of the University of Toronto appeared on the network's television programs.

"To be honest, I was terrible," she said. "Still, it was easy in those days. Nobody knew anything about television. They paid very little and anyone who had the nerve to get up in front of the camera was accepted. I had the nerve, as opposed to the talent."

Orenstein starred in and wrote for the CBC variety show The Barris Beat, produced by Norman Jewison, before moving to New York in 1965 and appearing on the CBS comedy show Candid Camera. He teamed up with another writer, Joan Rivers, until the day after his appearance on Johnny Carson's Tonight Show, he was fired and hit it off. Host Alan Fant "didn't want someone who was a bigger star," Orenstein said, "probably him."

He came to Los Angeles to write for ABC's Les Crane, and when that late-night talk show fell victim to Carson, he asked producer Nick Whanoff to let him fulfill his contract at Hollywood Palace, where he wrote material for the likes of Bing Crosby, Judy Garland and Fred Astaire.

He received an offer to write the pilot of a Pat Boone afternoon talk show in 1967 and enlisted the help of Turteltaub, whom he had met in New York. Turteltaub was working on the Boone show while Orenstein was stuck in Hollywood writing for NBC's Monkees, but the pair got together in the evenings to write sitcoms.

The first scripts they sold were for the comedies Hey, The Landlord on NBC, Good Morning, The World on CBS, and That Girl. They also wrote and produced the NBC variety show The Beautiful Phyllis Diller Show in 1968, hiring an unknown Lauren Michaels to help them.

In 1971, the writers moved to Arizona to work on the new Dick Van Dyke Show (the star played a Carson-like host) before returning to Los Angeles two years later to produce Love, American Style.

They went to Sanford and Son at the request of Lear, who needed producers who could deal with the good-natured Fox, who was involved in a contract dispute with the show at the time.

"We got along with him famously," Orenstein said. "He was very protective of us, two white Jewish boys writing a black play and being criticized by the Beverly Hills NAACP." Once, he recalls, he and Turteltaub got into their cars in the middle of the night to find Fox's dog, which had gotten loose. (They also bought several episodes written by Gary Shanling.)

When Fox left for a lucrative ABC deal, the pair worked on spin-offs Grady and Sanford Arms. And for what happens!! Orenstein saw Fred Barry and hired him to play Rerun, giving the character a nickname earned by taking frequent classes.

After Columbia Pictures's Screen Gems purchased TOY Productions - the sale took place in 1979 on the day What Happens! , Carter Country and 13 Queens Boulevard were canceled - they worked for Columbia on One of the Boys and One in a Million with What's Happening!! Actress Shirley Hemphill.

The two later found a foothold in television with future Murphy Brown creator Diane English producing the 1985–86 CBS sitcom Diane English.

After he and Turtletaub spent two years as story consultants on Cosby, Orenstein returned to school to earn his college degree. He wrote two novels: "Fender Mason" in 2011 about horse racing and "Black Sheep" in 2013 about comedy and crime. Teaching television history at Long Island University in Brooklyn. and bred purebreds.

In addition to his second wife, whom he married in February 1979, survivors include his children, Lisa, Barbara, Jennie and Alec; eight grandchildren; And her four grandchildren always lived with creativity, humor and boundless love, her family noted: keeping family close and finding joy in every moment.

In an interview with the Television Academy Foundation, Orenstein admitted that he had far more failures than hits.

"If you look at my resume, it's really sad if you want to be in this business," he said. "Although I've written hundreds of scripts and produced, I don't know, 40 shows, I'd say only four or five of them were really successful. It's not easy. But as a writer, you're never idle. You can always sit in front of a typewriter."

Gender-balanced hiring in 'backward' TV shows, new report finds (exclusive)