Product Documentation

FairCom RTG COBOL Edition User's Guide

Previous Topic

Next Topic

Advanced AcuCOBOL RTG Integration

In This Section

Adding Support for --setenv Command-Line Argument to Runtime

Appending Indices to Existing Files from the RTG FSI Interface (ACUCOBOL)

AIX 32-bit Server Shared Memory Requires EXTSHM ON

ACUCOBOL API for SQL Conversion Error Checking

Previous Topic

Next Topic

Adding Support for --setenv Command-Line Argument to Runtime

The ACUCOBOL-GT product allows the user to introduce new command-line arguments that can be passed to the ACUCOBOL-GT runtime. The function exam_args() defined in ACUCOBOL-GT's interface to C module sub.c is called immediately upon startup and is passed the command-line arguments that were passed to the runtime.

The c-tree module ctreeacu.c contains the function ct_exam_args() that provides support for ‑‑setenv command-line argument. The ‑‑setenv command-line argument can be used to set environment variables once the ACUCOBOL-GT runtime has already been started.

To add support for ‑‑setenv command-line argument, edit the sub.c module located in the ACUCOBOL-GT lib directory, for example: /usr/acucbl810/acugt/lib.

  1. Add the ct_exam_args() prototype declaration before exam_args() definition as follows:

    int ct_exam_args(int argc, char *argv[]);

    int

    exam_args(int argc, char *argv[])

    {

    return 0;

    } /* exam_args */

  2. Change exam_args() to call ct_exam_args() function as follows:

    int

    exam_args(int argc, char *argv[])

    {

    return ct_exam_args(argc, argv);

    } /* exam_args */

  3. Re-compile the ACUCOBOL-GT runtime as described in Recompiling the Windows Runtime or Recompiling the Unix Runtime.

Once the ACUCOBOL-GT runtime supports the --setenv command-line argument, you can call the runtime passing ‑‑setenv:variable=value, for example:

Windows

wrun32.exe cobol_Tutorial1.acu --setenv:DEFAULT_HOST=CTREE

Unix

runcbl cobol_Tutorial1.acu --setenv:DEFAULT_HOST=CTREE

TOCIndex