Analyze the FunctionEmulation Project

Guides you through the process of analyzing the FunctionEmulation COBOL program and project to become familiar with its use of SQL and to learn how it is compiled for HCOPG.

Analyze EXEC SQL in functionemulation.cbl

  1. From the Eclipse IDE, click File > Import.
  2. Expand General, and select Existing Projects into Workspace; then click Next.
  3. Select Select root directory; then browse to the $COBDIR/demo/sql/hcopg/functionemulation directory, and click Select Folder.
  4. On the Projects list, check FunctionEmulation.
  5. Check Copy projects into workspace.
  6. Click Finish. Eclipse loads the project and builds it automatically.
  7. From the COBOL Explorer, expand FunctionEmulation > COBOL Programs; then double-click the functionemulation.cbl file to view its contents. Pay particular attention to the EXEC SQL statement that references the user-defined functions.
  8. Close the code editor.

Analyze FunctionEmulation project properties

  1. Open the project properties for the FunctionEmulation project.
  2. Expand Micro Focus > Project Settings > COBOL; then select SQL Preprocessor. Several OpenESQL compiler directives have been set for you. The following table offers a brief description of each:
    SQL(TARGETDB=POSTGRESQL)1 Target database is PostgreSQL
    SQL(DB=HCODemo) PostgreSQL connection name is HCODemo
    SQL(PASS=userid.password) Database login credentials
    SQL(DIALECT=MAINFRAME) HCOPG database syntax conversion is enabled
    SQL(INIT) Initiates the database connection
    SQL(NOCHECK) No SQL compile-time checking performed
    SQL(BEHAVIOR=OPTIMIZED) Optimizes migration process
    1 To run against PostgreSQL GDG, you would need to change this to TARGETDB=PGSQL.