Joe: As I heard the story, Woody wrote the song after seeing the movie. He had not read the book. Hence, the song is not in the film, but retells the story of the film in Woody's words. And darned well, too. ("Preacher Casey dropped him in his tracks!")
Sandy