head->docNum->documentNum = number;

is not valid because docNum is not assigned anything.

Have you checked if your file exists and it reads the number into the variables fine.