Software AG Products 2.4.1 | Using Adabas Pre-Compiler on Linux | Working with the Example Files
 
Working with the Example Files
The /examples directory contains two example programs and a sample global configuration file (ADAGLOB.txt). You can use the example programs to verify the program and environment are correctly set up to use Adabas Pre-Compiler.
Viewing these programs in a text editor gives you an idea of what each does.
Load Adabas and Predict Example Data
The example programs are designed to work with the EMPLOYEES and VEHICLES Adabas example files. These files must be loaded into your LUW Adabas target database ID.
Note:
The EMPLOYEES file is delivered in the Adabas for Linux, UNIX and Windows installation examples under the name EMPLOYEES-NAT.
If the database containing these files is remote, you must have Entire Net-Work Client installed to access the remote database.
Your Predict data dictionary file (FDIC) must contain the example dictionary data for the example files.
The example programs utilize the relation between identical fields in the two example files. In order to compile the example programs, you must create a soft-couple relation between the two files in Predict. To establish this file relation, use the Natural SYSDIC library and perform the following:
1. Type M after Function for maintenance, type RL after Object Type, and press Enter to go to the file relation maintenance menu.
2. Type A after Function to add a file relation, type a name for the File relation ID, and press Enter to go to the adding a file relation menu.
3. Type S to add a soft-couple relation type, then enter File 1, File ID (e.g. EMPLOYEES, PERSONNEL-ID). Then, enter File 2, File ID (e.g VEHICLES, PERSONNEL-ID). Press Enter to add the file relation.
Compile the Program
Using the GnuCOBOL compiler, type the following to compile en example program:
gadpcomp.sh ./program.cob
Compilation errors are printed in the console and logged in the ADAMES.txt file, located in the current direcotry.
Execute the Program
To execute the compiled program:
1. Specify the appropriate Adabas database ID for the SQL_DEFAULT_DBID environment option.
2. Execute the program.
./program