Are you doing any go to statements that would cause execution to go to a section outside of the output procedure? Are you doing an exit program or goback within the output section instead of letting it exit normally?
Like Austin1 stated, we really need to see the source or else it is just a guessing game...
Thanks.