In the opening chapter – or scene, if you prefer – of Harry Grey's pseudonymous memoirs The Hoods, the five friends, Noodles, Maxie, Cockeye, Patsy and Donny are in school. Cockeye is reading a pulp western about the exploits of the James Gang, and fantasises about going out west, becoming a cowboy and joining them. He does not realise that the gang are dead and the wild west is no more until Noodles tells him.
It's an opening that I think helps explain why Leone became obsessed with bringing Grey's story to the screen, even if his own Once Upon a Time in America does not feature this scene.
It is all about the end of the “real” west and the printing of the Fordian “legend;” the shift from a rural to an urban environment; the gangster supplanting the cowboy as the idealised popular cultural figure of the man with a gun living and dying by a code; the replacement of the horse with the motor car; the emergence of the movies as a way in which American mythologies circulated. Thus, as Grey's memoirs continue, we get the blending of fact and fiction, as his memories of the gangster life become intermingled with the idioms of pulp crime writing and Hollywood gangster films.
In the period it took Leone to bring the novel to the screen he reluctantly directed the Mexican-revolution set Duck You Sucker. Juan's obsession with robbing the bank at Mesa Verde there mirrors Maxie's obsession with robbing the Federal Reserve in The Hoods.
The theme of betrayal also runs through both works, with Sean/John's memories of being betrayed by his colleague in the IRA and his eventual questioning of what he has done to Juan in using him for the revolution, along with Noodles' betrayal of his friends by informing the police on them. Grey novel, however, obviously does not feature the double-betrayal structure of Leone's film, where Maxie is presented as the brains behind the operation and Noodles, who has thought himself to be the betrayer for some 30 odd years, discovers himself to be the betrayed.
This double-betrayal aspect meanwhile also perhaps helps make somewhat akin to Leone's version of the Borges story The Theme of the Traitor and the Hero, itself with an Irish setting, which also formed the basis for Bertolucci's more personalised take on it in The Spider's Stratagem, in which the young hero discovers the truth behind his father's reputation as an anti-fascist hero.