Demonstration Program

As soon as your installation and setup are complete, you may run the demonstration program ("demo.cbl") included on your distribution medium. This program illustrates many of the Acu4GL product capabilities, including:

The demo program simulates what might be used in a distributor's shipping department. You'll be creating the acuorders table, which contains information about the orders placed by the distributor's customers. The acuorders table has the following columns of information (the database data type and COBOL data type are shown for each):

Note: The data type may be slightly different depending on the RDBMS.
Column Name Data Type COBOL PIC
order_name varchar(4) pic 9(4)
order_date int pic 9(6)
customer_num varchar(3) pic 9(3)
ship_instruct varchar(40) pic x(40)
backlog varchar(1) pic x
po_num varchar(10) pic x(10)
ship_date int pic 9(6)
ship_weight decimal(8,2) pic 9(6)v99
ship_charge decimal(6,2) pic 9(4)v99
paid_date int pic 9(6)

Here is the COBOL FD (file descriptor) that matches the acuorders table. Note that the FD entries must match the names of the RDBMS fields and must match their data types:

fd  orders. 
01  order-record. 
    03  order-num              pic x(4). 
    03  order-fields. 
        05  order-date         pic 9(6). 
        05  customer-num       pic 9(3). 
        05  ship-instruct      pic x(40). 
        05  backlog            pic x. 
        05  po-num             pic x(10). 
        05  ship-date          pic 9(6). 
        05  ship-weight        pic 9(6)v99. 
        05  ship-charge        pic 9(4)v99. 
        05  paid-date          pic 9(6). 

Compiling and Running the Demo Program

Perform the following steps to compile and run:

  1. Compile using the applicable command line:

    Windows: ccbl32 -Fx -o demo demo.cbl

    UNIX: ccbl -Fx -o demo demo.cbl

    This compiles the program and generates the ACUCOBOL-GT data dictionary orderfile.xfd. The runtime system will use this data dictionary to map RDBMS data types to COBOL data types.

  2. Verify the runtime by entering the applicable command:

    Windows: wrun32 -vv

    UNIX: runcbl -vv

    Be sure that the version information you receive references your Acu4GL product.

  3. Notify the ACUCOBOL-GT runtime system that you are interfacing to an RDBMS driver. You accomplish this by adding the following line to your runtime configuration file or to the machine's environment:
    DEFAULT_HOST RDBMS_NAME 

    If you're running demo.cbl from the same directory where you placed the ACUCOBOL-GT data dictionary, you are ready to run. If the data dictionary (orderfile.xfd, created when you compiled the demo program) is in another directory, you will need to add the following line to the cblconfig configuration file:

    XFD_PREFIX dir-containing-dictionary  
  4. Set any environment variables required for your specific Acu4GL product. See the Designating the Host Data Source or Designating the Host File System topic in the Appendix specific to your particular RDBMS.
  5. run the demo program by entering the applicable command:.

    Windows: wrun32 -c config demo

    UNIX: runcbl -c config demo

Depending on your system, you will see either a character or window based version of the program.

The demo program enables you to view or change any of the rows (records) in the orders table.

You can also view the source code for the demo program from the Options Menu. Selecting View Program will start the debugger and display the source code. Be sure you compiled the program with -Zd and executed it with -d.