The book for 2001 was mostly based on earlier stories written by Clarke and written down in full DURING the making of the movie; not afterwards, as you claimed.
2001: A Space Odyssey, was published soon after the film was released.