Search code examples
cobolacucobol-gt

AcuCobol external call


I'm trying to integrate some functionality from my company's old system to our new one.

We have some COBOL code running on ACUCOBOL v6.2 . Is there a simple way of making an external http call / or even a non-http call without purchasing AcuToWeb or another software bundle.


Solution

  • I can think of a few ways to handle this:

    1. Call an external (non-cobol) program via opening a "file" with the file name beginning with "-P". This makes acucobol create a pipe to the program. You can either read or write to the external program but not both. I typically use command line arguments or a regular file for the other side of the conversation, but you can't easily have both open at the same time. For example, open -Pcurl https://www.google.com/?q=acucobol for input, or -Pps2pdf > /tmp/pdf-file as output and send it some postscript.
    2. Call an external program via CALL "SYSTEM" USING COMMAND-LINE
    3. Create a C subroutine that will interface with the external system, and use AcuCOBOL's methods of linking with C programs.