B. TRAVEN, author of more than a dozen novels and collections of short stories, was one of the most mysterious figures of 20th-century fiction. His books have sold over 25 million copies in a score of languages. Several films, including John Huston's award-winning The Teasure of the Sierra Madre, were made from them. But the man himself stayed hidden, communicating with his publishers only by letter, revealing his identity to no one, not even friends and family.

Legends grew up around him -- that he was a president of Mexico, or the American writer Jack London, or a German revolutionary on the run, or the bastard son of Kaiser Wilhelm II. No one knew what he looked like, his nationality, his age. Some thought B. Traven was a pen name for a group of leftist Hollywood writers, others thought he was a woman. There was even confusion over the language in which he wrote. All that was known for sure was that Traven lived in Mexico, and that from 1926 to 1940 he produced a series of tough, best-selling novels about injustice and exploitation and about the struggle of the Mexican Indians against the encroachments of national and international capitalism on the way of life they preferred.

For years, journalists and scholars have tried to penetrate the veil of mystery and false identities Traven drew around himself. Two recent attempts are described in this pair of quite different books.

In My Search for B. Traven, Jonah Raskin, an American writer and professor, puts more emphasis on "my search" than on "B. Traven," and the result is a personal account of his experiences while trying, unsuccessfully, to learn Traven's identity. Will Wyatt, a British filmmaker for the BBC, presents a straight-forward journalistic investigation in The Secret of the Sierra Madre, tracking Traven through interviews with people connected with his books, those who knew him in one of his many identities, and finally by following the trail of paper and documents through several countries back to the registry office of a small town in Poland.

Wyatt's approach is infinitely more satisfying and not only because he succeeded where Raskin failed. There is excitement in Wyatt's journalistic pilling of one documented clue atop another, and in the sudden stabs of luck and intuition that finally cement them together.

Raskin had a head start, beginning his search for Traven in 1974, the same year that Wyatt first heard Traven's name pronounced in a New York bookstore. Raskin spent most of 1975 in Mexico and lived for a time in Traven's house in Mexico City with his widow, Rosa Elena Lujan, and her two daughters by an earlier marriage. He went through Traven's papers and notebooks, began to wear his clothes, had his own lenses put in the rims of Traven's eyeglasses. He traveled through Chiapas, Mexico's far southern state, where Traven had traveled and worked, saw the continuing misery of the Indians which Traven had depicted. Gradually, he says, he began to feel Traven's presence. Raskin awakened one morning hallucinating that his right arm was Traven's.

Finally, he concluded he could not write the biography, not only because there were still too many puzzles, but because Traven had wanted his life kept secret. His mystery was part of his contribution, Raskin decided, and should be kept inviolate.

Wyatt also felt Traven's presence, but more as a curse on his efforts to uncover the secret, a curse that jinxed cameras, prevented interviews, threw up unforseen roadblocks. But Wyatt had resources Raskin lacked -- the staff and reach of the BBC, colleagues, researchers, a corporate name that opened doors. Unlike Raskin, he could fly off to Poland at a moment's notice, have a mayor open the town hall on Sunday morning just to show him birth registry books from the last century.

In the end, Wyatt found Traven. He reconstructs the life of a man born out of wedlock to a brickmaker, not a kaiser, experiencing parental rejection and frustration of hopes for a career, an anarchist journalist in revolutionary Bavaria after World War I, fleeing for his life without papers and harassed by the police of half a dozen countries, who finally breaks away to freedom in turbulent Mexico where he finds his great theme as well as the new identity to protect him from political retribution from abroad.

Traven had reason to hide. He'd been sentenced to death in Germany. When the Nazis came to power, his books were burned. But the secrecy became an obsession, his identity something to hide not only from enemies, but from everyone.

Wyatt has broken through Traven's defenses in a plausible, convincing manner. And yet . . . Raskin ended by deciding he had no right to expose the identity. Wyatt says he raised that question himself at the outset of his search. "At all costs he did not wish to be tracked down," he says of Traven. "Do we rob his grave if we defeat him now? And like a true son of the Western world, Wyatt answers: "I think not. It is beyond our capacity to trouble him; we cannot steal his spirit away even if we uncover much of what he tried to hide, and there is no reason why he should instruct us from the grave. . . . After death, a man's life belongs to history and to the curious stranger."

Ironically, it is just that Jeffersonian article of faith, that everything belongs to the living, not to past or future generations, that was anathema to the Indians Traven wrote of so well. In The White Rose, Traven contrasts the unequal struggle of a giant oil corporation with all its resources of money, communications, power, and political contacts marshalled against the organic strenght of an Indian community bound by the reverence for the past and responsibility for the future. The company wants the oil now. The Indians want to preserve their land for future generations. It is, of course, no contest. Nor did B. Traven ever really have a chance, despite his creativity about covering his tracks. Cornered by the British police in 1923, facing death in Germany and closed doors in every other country, he let slip his real name, and 55 years later, the worldwide resources of the BBC tracked him down. The ending could have come from one of his own novels.