Tim O'Brien's Vietnam novel, "Going After Cacciato," upset two heavily favored contenders to take the fiction prize in the 1979 National Book Awards. "Robert Kennedy and His Times" by Arthur M. Schlesinger Jr. won for biography, and former Washington author Katherine Paterson took the children's category with "The Great Gilly Hopkins."

The 30th annual awards were announced yesterday afternoon in a hot and crowded room at the Association of American Publishers, the sponsor of the awards. AAP president Townsend Hoopes introduced the judges who announced the decision of the three-person jury in each of seven award categories.

Other winners included Peter Matthiessen's "The Snow Leopard" (Contemporary Thought); the monumental three-volume "Intellectual Life in the Colonial South, 1585-1763" by Richard Beale Davis (History); James Merrill's "Mirabell: Books of Number" (Poetry), and "The Complete Posthumous Poetry" by Cesar Vallejo, translated by Clayton Eshleman and Jose Rubia Garcia (translation).

"Going After Cacciato" recounts an infantry squad's occasionally surreal pursuit of a soldier who has decided to walk to Paris, away from Vietnam and its horrors. There was surprise and some consternation when judge Mary Lee Settle - last year's NBA winner for "Blook Ties" - announced O'Brien's win.

Until yesterday, it was widely felt that the choice would be between John Irving's "The World According to Garp" or "The Collected Short Stories of John Cheever" - this year's winner of both the National Book Critics Circle award for Fiction and a Pulitzer Prize.

When asked whether the jury - consisting of Settle, Alison Lurie and Wallace Stegner - had had a difficult time Settle said, "We feel very good about it. The decision was reached very quickly among the three of us."

Henry Robbins, editor and publisher of "Garp," said after the announcement that he was "Disappointed, of course." Robbins explained that he found it "ironic" that a book like "Garp" that had the "almost universal consensus as the outstanding novel of the year should fail to receive any of the prizes."

"Robert Kennedy and His Times" is a comprehensive and detailed account generally sympathetic to its subject. Schlesinger's earlier book about John Kennedy, "A Thousand Days" received the NBA for biography in 1966.

Katherine Paterson, who until recently lived in Washington and now resides in Norfolk, Va., is the author of several award-winning children's books, including "The Mister Puppeteer" (NBA, 1977) and "Bridge to Terabitha" (1978 Newbery Medal). "The Great Gilly Hopkins" is the story of an 11-year-old girl who, after a variety of foster families, eventually finds real family life in the home of a fat, semi-literate widow.

"The Snow Leopard" describes an expedition by author Matthiessen and field biologist George Schaller into the Himalayan mountains in search of the semi-mythical snow leopard. But the book quickly becomes an exploration of the landscapes of the soul, culminating in a moment of self-discovery.

"Intellectual Life in the Colonial South, 1585-1763" is an exhaustive study of the creation and seminal influence of what W. J. Cash once called "The Mind of the South." Davis is the Alumni Distinguished Service Professor Emeritus of American Literature at the University of Tennessee.

"Mirabell: Books of Number" is the eigth volume of poetry by James Merrill, and the book-length sequel to "The Book of Ephraim," a long poem included in "Divine Comedies," which won the Pulitzer Prize in 1977.

Cesar Vallejo was a distinguished Peruvian poet. This volume of 110 poems written between 1923 and 1938 offers both English translations and the standard Spanish text. Clayton Eshleman has translated some 30 volumes of poetry; Jose Rubia Garcia is professor of English and Portugese at the University of California at Los Angeles.

The winners will each receive a $1,000 prize and a citation. The official presentation will take place tomorrow at Carnegie Hall. This year's master of ceremonies will be Dick Cavett, with Sen. Daniel Patrick Moynihan as special guest speaker. The awards banquet will highlight a week of book activities, including panel discussions of children's literature, crime and crime writing.