Acu4GL® FAQ



October 31, 2002
  1. What does Acu4GL do?
  2. When should I use Acu4GL?
  3. What databases are supported?
  4. Do I need to switch all of the ISAM files in my system to RDBMS tables?
  5. How does Acu4GL manage the differing ways that COBOL?
  6. Can I affect the way that XFD files are generated?
  7. My application makes use of multiple record types and REDEFINES. How does Acu4GL cope with this?
  8. XFD files are matched to tables through their names. My files use variable names; what can I do?
  9. Compare database access through Acu4GL and the use of Vision files.
  10. What file operations should be avoided?
  11. Can I make use of more of the power of the RDBMS with Acu4GL?
  12. Can I use Acu4GL to create database tables, grant and revoke access privileges, and so on?
  13. Can I see the SQL that Acu4GL is generating?
  14. How are database errors reported to the COBOL program?
  15. Must the database table match the COBOL FD exactly?
  16. Does using Acu4GL mean that I don't need a database administrator?
  17. Can I use Acu4GL with AcuServer™?

  1. What does Acu4GL do?
    Acu4GL is a solution that allows an ACUCOBOL-GT® program to access a Relational Database Management System (RDBMS) in a seamless manner. That is to say that the COBOL program is written to use ISAM file access. Acu4GL generates Structured Query Language (SQL) dynamically and uses the RDBMS to access the data.

    Back to top


  2. When should I use Acu4GL?
    Owners of COBOL applications that use standard I/O verbs (OPEN, READ, WRITE, READ NEXT, and so on) can use Acu4GL to provide their end users with access to RDBMS systems without rewriting their applications to use embedded SQL. Applications that already make use of embedded SQL will probably continue to do so. Acucorp offers AcuSQL® as a solution in this area.

    Back to top


  3. What databases are supported?
    Currently Acucorp offers support for the following RDBMS systems:

    Oracle
    Informix
    Microsoft SQL Server
    IBM DB2
    Sybase

    Other systems may be accessible through the use of Acu4GL for ODBC.

    Back to top


  4. Do I need to switch all of the ISAM files in my system to RDBMS tables?
    Not at all. Which file system will be used for any given file is specified in the runtime configuration file. Work files, for example, can and should be left as Vision files.

    Back to top


  5. How does Acu4GL manage the differing ways that COBOL and databases store data?
    Acu4GL makes use of extended file description (XFD) files to "translate" from COBOL data types to RDBMS data types. The compiler produces these XFD files automatically when the "-Fx" compiler option is used. The exact data types used are database dependent.

    Back to top


  6. Can I affect the way that XFD files are generated?
    To some extent, yes. The programmer can make use of XFD directives to influence the compiler's output. This can be used (for example) to store items at group level, change the database table names, or store dates as database "date" fields. For more information, see Chapter 4 of the Acu4GL User's Guide.

    Back to top


  7. My application makes use of multiple record types and REDEFINES. How does Acu4GL cope with this?
    Acu4GL makes use of an XFD directive, the "WHEN" directive to manage multiple record types and REDEFINES clauses. You should be aware that this can lead to very "wide" tables and you may wish to consider restructuring any particularly complex tables for performance reasons.

    Back to top


  8. XFD files are matched to tables through their names. My files use variable names; what can I do?
    Acu4GL provides an environment variable called XFD-MAP for this situation. As an example, the setting:

        XFD-MAP     CUST*=CUSTOMER

    would mean that any table name beginning "CUST" would make use of the CUSTOMER.XFD file. See section 8.2 of the Acu4GL User's Guide for more details on this variable.

    Back to top


  9. Compare database access through Acu4GL and the use of Vision files.
    Accessing an RDBMS is likely to involve more overhead than simple ISAM access. It is reasonable to expect that the use of Vision files will be faster than an RDBMS in most circumstances. Exactly how great the difference will be for any given system is extremely difficult to predict. What we can say is that many of Acucorp's customers are making very successful use of Acu4GL in production environments.

    Acucorp's experience is that simple benchmarks do not greatly assist in assessing system performance. We strongly recommend that any organization considering the use of Acu4GL should carry out benchmarking tests using a real application with realistic data volumes.

    Back to top


  10. Are there particular operations that affect performance?
    Some file operations are more "expensive" than others in terms of the amount of processing required. The most noticeable of these is the OPEN verb. Some older systems were written so that each I/O operation would be "wrapped" in an OPEN and a CLOSE. This is generally bad practice, but the performance of Vision masked the performance hit. When switching to an RDBMS, the overhead will become very apparent. Such code should be amended to remove the superfluous OPENs.

    Back to top


  11. Can I make use of more of the power of the RDBMS with Acu4GL?
    Acu4GL will make use of the database's engine to access the database, ensuring that the RDBMS query engine and optimizer will be fully utilized. A database administrator can ensure that the database and its tables are fully optimized for Acu4GL's access techniques.

    Acu4GL is equally at home accessing database tables or views. This ability can be used to harness the power of the database to find the data, allowing COBOL to do its job of processing the results.

    The programmer can make additional use of Acu4GL's features. An excellent example of this is the external variable A4GL-WHERE-CONSTRAINT, which allows the programmer to make use of the RDBMS's data selection abilities. More information on this can be found in Section 9.1.2 of the Acu4GL User's Guide.

    Back to top


  12. Can I use Acu4GL to create database tables, grant and revoke access privileges, and so on?
    The simplest way to create a database table is, of course, to do an OPEN OUTPUT from the COBOL program. Other activities (any SQL command that does not return data to the application) can be performed by calling a program called "SQL.ACU" (supplied with Acu4GL), with the command as a parameter. For example:

       CALL "SQL.ACU" USING "DROP TABLE MY_TABLE".

    The programmer can then check the global variable RETURN-CODE to check for success (a value of "0" indicates successful completion).

    Back to top


  13. Is there a way for me to see the SQL that Acu4GL is generating?
    Yes, the debugger's file tracing facility will show you the generated SQL. As an example, you would start the runtime with the additional flags "?dle filename" where filename is the name of an output file for the file trace.

    When the debugger starts, give the command:

       TF9

    which turns on the debugger with a high level of tracing. In the output from the debugger you will see all of the generated SQL, together with results codes.

    Back to top


  14. How are database errors reported to the COBOL program?
    Where errors can be "translated" into a common COBOL error, this is done. For example, if a table was opened for input and it did not exist, a standard error "35" would be returned to the program.

    Where no suitable COBOL error exists, an error 9D is returned and a secondary error code is set. This secondary code is the code returned by the RDBMS. The programmer may make use of the ACUCOBOL-GT routine "C$RERR" to obtain the secondary code.

    Back to top


  15. Must the database table match the COBOL FD exactly?
    All the columns named in the XFD file must exist, and have consistent data types. The behavior for any "extra" columns in the table is database dependent. For Informix and Oracle, extra columns are ignored. For other databases an error is generated, unless the configuration variable 4GL-EXTRA-DB-COLS-OK is set to "1", in which case no error is produced.

    Obviously, for consistency, any key that does not allow duplicates should match a unique index in the table, but no other indexes are required. Tables may be indexed as recommended by a database administrator.

    Back to top


  16. Does using Acu4GL mean I don't need a database administrator?
    A typical RDBMS is a complex piece of software, which requires the skills of an experienced DBA to get the best from it. While it is (at least in theory) possible to get by without a DBA, this will almost certainly mean that performance and reliability will be negatively impacted.

    Back to top


  17. Can I use Acu4GL with AcuServer?
    AcuServer is a Vision-only solution, so cannot be used to access RDBMS tables. Many database vendors provide client/server access to their systems and this can be used by Acu4GL. Alternatively Acu4GL works in combination with both AcuConnect® and the ACUCOBOL-GT Thin Client. For more information on Acu4GL in specific client/server environments, please contact your Acucorp Sales Professional.

    Back to top

Your Session will expire in 90 minutes
Notification will be shown in:
600 seconds