This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Runcobol redirect output to a file on Windows

Hi,

In the past it was normal tu use > to redirect DISPLAYs to a file like runcobol myprogram > myoutput.txt, but this is not working anymore under Windows. Is it possible to redirect the output to a file on Windows like on Linux?

Regards,

 

  • 0

    Hi Juan:

    Graphical Windows programs like the RM/COBOL runtime don't have the concept of terminal I/O redirection.  Redirection is possible in UNIX and Windows console programs because the console/screen/command window is just another stream device that data is written to. So it's simple to redirect the output to a different device and send the data to a file instead of the screen.

    The methods that graphical programs use to handle the display are completely different, and cannot be redirected into a file.  If this was possible, the written data wouldn't make any sense. 

    Also, Windows programs are generally launched from icons, and Windows does not support the "> >>  <" redirection operators except for programs running under CMD.EXE.

    It is possible for Windows programs to internally simulate this kind of redirection, but RM/COBOL for Windows has never done that.  You'd have to go back to the DOS Extender-based version 6 to get this feature and I doubt it would run on any version of Windows.

  • 0 in reply to 

    Hi Uwe, I hope  you are fine!

    The reason to use output redirection is for QA purposes, to check functions and then analize the content of the file to look for fails in it. It seems RM is the only one that does not support this under Windows. It works with Acu and MF. I will think on a way to capture those displays.

    Best regards,

     

  • 0 in reply to 

    Well it seems Acu also generates an empty file on Windows.

  • 0 in reply to 

    Hi Juan:

    I'm doing well -- hope you are too.

    The behavior you described, producing an empty file, is what I'd expect if you launch any GUI program from the command line. 

    For example, on Windows, running this command:

    RUNCOBOL program >output.txt

    will produce an empty output.txt file.  The reason is that Windows CMD.EXE parses the command line, redirects standard the standard output file handle into output.txt (creating or overwriting the file), then launches RUNCOBOL.EXE as a GUI program.  GUI programs do not have access to these file handles so the file remains empty.

    I believe that ACU does provide a console runtime system on Windows that presumably uses stdin/stdout/stderr; RM/COBOL includes a console-mode compiler but not a runtime system.

  • Verified Answer

    0 in reply to 
    Hi Juan:

    I suggest you put in an enhancement request for screen I/O redirection and/or the ability to run RMCOBOL programs in a Windows console.