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. In Visual Studio, open the solution named FunctionEmulation, which is located in the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\SQL\hcopg\FunctionEmulation directory.
  2. From the Solution Explorer, open the FunctionEmulation.cbl file to view its contents. Pay particular attention to the EXEC SQL statement that references the user-defined functions.
  3. Close the code editor.

Analyze FunctionEmulation project properties

  1. Open the project properties for the FunctionEmulation project.
  2. Notice that the Output type on the Application tab is Console Application.
  3. Switch to the COBOL tab, and set the following:
    Configuration Active (Debug)
    Platform target x86
  4. Switch to the SQL tab. Several OpenESQL compiler directives have been set for you. The following table offers a brief description of each:
    SQL(TARGETDB=POSTGRESQL) 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(DBRMLIB) EXEC-SQL commands are extracted and placed in database request module (DBRM)
    SQL(INIT) Initiates the database connection
    SQL(NOCHECK) No SQL compile-time checking performed
    SQL(BEHAVIOR=OPTIMIZED) Optimizes migration process