Are you saying that the program fails in the Debugger, but that you can run it successfully in an on-line ONE session?
ONE is a development environment, and although it has a built-in runtime component, It is not intended to run batch processes, that is, those with printer and/or work files. You are expected to run a batch script for such batch processes.
As a quick fix, add a DEFINE WORK FILE statement to the beginning of the program, such as
DEFINE WORK FILE 01 'c:\full-qualified\file-name.txt'