ACUCOBOL-GT requires the runtime to be compiled with the FairCom DB configuration enabled. The following steps will guide you through this task.
Linking the ACUCOBOL-GT runtime with the FairCom DB client libraries requires a suitable compiler installed:
Follow these procedures:
copy win32\Driver\ctree.cobol\Acucobol\ctreeacu.c C:\AcuGT\lib
copy win32\Driver\ctree.cobol\Acucobol\mtclient.dll C:\AcuGT\bin
copy win32\Driver\ctree.cobol\Acucobol\ctutil.exe C:\AcuGT\bin
Open the Visual Studio 6 workspace: wrun32.dsw
Open the Visual Studio 2005 solution: wrun32.sln
ACUCOBOL-GT 9.X:
Open the Visual Studio 2008 solution: wrun32.sln
There are three entries to modify:
#ifndef USE_VISION
#define USE_VISION 1
#endif
Add the following additional define section:
#ifndef USE_CTREE
#define USE_CTREE 1
#endif
extern DISPATCH_TBL v5_dispatch,...;
Add the following extern definition:
extern DISPATCH_TBL ct_dispatch;
TABLE_ENTRY file_table[] = {
#if USE_VISION
{ &v5_dispatch, "VISIO" },
#endif /* USE_VISION */
Add the following additional define section:
#if USE_CTREE
{ &ct_dispatch, "CTREE" },
#endif /* USE_CTREE */
FairCom version 11.0.xxxxx-yymmdd file system (interface v11.0.xxxxx-yymmdd)
cp linux.v2.6.x86.32bit.COBOL/Driver/ctree.cobol/Acucobol/ctreeacu.c /usr/acucbl810/acugt/lib
cp linux.v2.6.x86.32bit.COBOL/Driver/ctree.cobol/Acucobol/libmtclient.so /usr/acucbl810/acugt/bin
cp linux.v2.6.x86.32bit.COBOL/Driver/ctree.cobol/Acucobol/ctutil /usr/acucbl810/acugt/bin
There are three entries to modify:
#ifndef USE_VISION
#define USE_VISION 1
#endif
Add the following additional define section:
#ifndef USE_CTREE
#define USE_CTREE 1
#endif
extern DISPATCH_TBL v5_dispatch,...;
Add the following extern definition:
extern DISPATCH_TBL ct_dispatch;
TABLE_ENTRY file_table[] = {
#if USE_VISION
{ &v5_dispatch, "VISIO" },
#endif /* USE_VISION */
Add the following additional define section:
#if USE_CTREE
{ &ct_dispatch, "CTREE" },
#endif /* USE_CTREE */
NOTE: The c-tree entry must be added below the Vision entry so as to leave the Vision entry the first one in the file_table[] array.
Add the c-treeRTG ACUCOBOL source module to the line FSI_SUBS=, for example:
FSI_SUBS= < ... > ctreeacu.c
Note: There may be other items already listed in FSI_SUBS. Leave those in place and only add ctreeacu.c.
FairCom version 11.x.xxxxx-yymmdd file system (interface v11.x.xxxxx-yymmdd)
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.
int ct_exam_args(int argc, char *argv[]);
int
exam_args(int argc, char *argv[])
{
return 0;
} /* exam_args */
int
exam_args(int argc, char *argv[])
{
return ct_exam_args(argc, argv);
} /* exam_args */
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