"The End," a melancholic comedy about a Los Angeles realtor, played by Burt Reynolds, who learns that he has a terminal illness, is seriously flawed but sporadically hilarious.Directed by Reynolds himself from an original screenplay by Jerry Belson, who also wrote "Smile," "The End" doesn't add up, but it remains a diverting oddity distinguished by isloated scenes, jests and performances that are audaciously funny.

Belson's scenarios recalls evenings of improvisatory comedy. Although the episodes are unified around the emotional crisis of the hero, named Sonny Lawson, each episode seems self-contained, and the consistency is strictly hit-and-miss.

The authentic note of trigocomic absurdity in Belson's material derives from his perception of Sonny's self-pity. Suddenly preoccupied with the prospect of his own death, Sonny would like other people to give him undivided attention and sympathy. For various reasons they can't oblige: His new-found obession isn't quite real to them; they're preoccupied with their own lives; his bids for sympathy are too ambiguous to be interpreteted clearly.

Whatever the response, the essential fact remains that Sonny is asking the impossible.He can't stop the flow of life merely because his own existence is threatened.

Belson has a distincive sense of humor, evident in the first remark Reynolds as Sonny makes to Norman Fell as his doctor: "It's the ame thing Ali McGraw had in "Love Story," isn't it?" Fell doesn't help much by gently correcting him: "No, you have a toxic blood disease. I believe Miss MacGraw was suffering from leukemina." He's even less consoling moments later when Sonny asks how long he has to live: "That's difficult to say. Even as we speak a research scientist in a laboratory somewhere may be in the process of discovering . . .

Reynold's direction is much more polished than it was in "Gator." Comedy writers may feel especially safe with him because Reynolds show exceptional respect for The Words. Fine comedy timing is one of his strong points as an actor, and it's apparent throughout "The End" that he wants the funny lines to stand out. He never composes or cuts in ways that would do anything but enhance the humor and spontaneity of the dialogue.

If anything, this verbal attentiveness may produce a mood that's rather too epxectant and sophisticated for a screenplay destined to flounder in farcical quicksand. The high comedy promise of the opening episodes is eventually betrayed as Sonny's closest relationships become trivialized and the plot degenerates into a string of two-reel comedy situations about his repeated attempts to commit suicide. In retrospect, it may even seem damningly significant that the best scenes find Sonny playing straight man to total strangers, Robby Benson in a delightful bit as well-meaning but inept young priest and Dom DeLuise in a zang showstopper as a certifiable nut.

The DeLuise character, a Polish-American schizo called Marlon Borunki whose symptoms include a compulsion to tell the Polish jokes that he also resents, would be even more effective if he were limited to one scene.

A failed protagonist as well as a failed suicide, Sonny proves a glum, unrewarding role for Reynolds. The key deficiencies are in the conception of the character rather than the performance. Sonny ought to be an ethnic and mental counterpart of the brooding Jewish humorist who invented him. Looking at Reynolds, you'd swear he thought he was playing a Jewish character. His intuition is quite sound, but Belson defines Sonny arbitrarily. One never quite believes in the profession, religion, wife, mistress, daughter, parents and level of intelligence he's assigned.

Unlike the remarkable first feature "Hot Tomorrows," in which young filmmaker Martin Brest confronts a fixation with death squarely and resolves it with a brilliant, transcendent flight of lyricism, "The End" lets the subject slip away after an initial promise of a fresh, humorous, emotionally honest perspective. The elation of the good senses, in which life seems to be satirically mocking the hero's preoccupation with death, isn't sustained or completed.

It's encouraging to learn the Reynolds and Belson intend to collaborate again. They've frittered away a potentially great comic premise by falling back on trite situations and indiscriminate buffoonery. Inadvertently, the closing images verify one's disappointment: The movie ends up literally at sea and literally chasing its tail.

Still, this is the kind of failure smart filmmakers could grow on. With this intriguing shipwreck to guide them, Reynolds and Belson may find it easier the next time to separate revealing absurdities from meaningless farce.