The writer whose novel goes to Hollywood often winds up feeling like the carpenter who built the Ark and then got left behind.

Take Walter Wager, who put together in his spare time - he is public relations director for ASCAP in New York - a taut, sharp suspense novel into one of those Major Motion called "Viper Three." It was turned intto one of those Major Motion Pictures: "Twilight's Last Gleaming," with a whole new dimension of inept political posturing that leaves the viewer with a head full of questions.

"I'm not denouncing (director) Robert Aldrich," Wager said. "He put his dream on the screen and it happened not to be my dream. I found it interesting."

The book ends with the President, as volunteer hostage, meeting the desperate men who have taken over a missile slip and are threatening World War III unless given money and freedom. In the movie everyone gets killed, including - the President, apparently on the unspoken order of the power elite in Washington.

Wager left the ending open, and it works: "I was hoping they'd take the presidential pardon and scram. I didn't want 'em killed, I kind of liked 'em."

But the movie ending has gaping and ludicrous holes: Why didn't the President wear a bulletproof vest? For heaven's sake, why did the desperadoes let themselves be maneuvered into a 100-yard walk in the open? It's enough to break an author's heart.

Walter Wagner's heart is not so easily broken, however. So far he has published 18 books, some under the name of John Tiger, including two "Mission Impossible" original and seven "I Spy" books. He has finished one screen play and is working on another.

"When I was cut in Hollywood I hear the basic law on screenplays: Never write the first one. They always throw that out. Once I got a look at one and said I could do better, so they let me, said it was wonderful, bought it - and never did a thing with it."

The wonders of Hollywood never pall on him. The screenplay he sold was named "Swap," being about an exchange of international agents, but the moguls thought that title too suggestive. So they changed it. To "Operation Snatch."

"I love Hollywood," remarked the buoyantly energetic Wagner, who in his 52 years has collected two law degrees, a Fulbright in air law special assignments with Israel Civil Aviation and the New York attorney general, and editorships of magazines like Playbill and Show."

"The first time I walked into the lobby of the Beverly Wilshire, two hookers came up and told me what they could do for me for $100. I thought, holy smoke, this is the real Hollywood. But then I went out to a friend's house you know, with the Henry Moores and the Brancusis in the yeard, and four kinds of cognac. I love it. Why at the MGM commissiary they have a box of matzos on every table - and it's not even he holy days. My mom woulda been so pleased."

Wagner, who turns out a novel in seven months, working from 8 p.m. to midnight and never bothering to rewrite, has no more books under option.

Meanwhile, director Don siegel is filming anohter Wagner novel, "Telefon," in Finland an the U.S. West. Duc out in December, it will star Charles Bronson, Lee Remick and Donald Pleasence and already has been condemned by Izvestia as "naive and banal," to no one's particular consternation.

Still another book, "Time of Reckoning," will be issued in June by Playboy Books.

"I like the book a lot, and I'l buy at least 20 copies." Wagner deadpanned. "Of course, I get a 40 per cent discount."