Tutorial: Application Migration - Converting Labeled Duration Calculations

Provides step-by-step instructions to migrate DB2 labeled duration calculations and date formats to PostgreSQL.

PostgreSQL does not support labeled duration calculations directly. HCOPG handles the conversion to PL/pgSQL to implement the DB2 syntax of an EXEC SQL statement using labeled durations.

Prerequisites

  • If you have not already done so, review the Assumptions and Before you begin a tutorial section in the Tutorials: HCO for PostgreSQL (HCOPG) topic to ensure your environment is set up properly.
  • Before attempting this tutorial, you must first work through the steps in Tutorial: Create and Load the HCO_Test Database.
  • The ODBC environment must be configured to compile and execute the application
  • You must create the HCODEMO ODBC DSN alias pointing to the HCO_Test PostgreSQL database .

Eclipse project - LBLDURATION

The Eclipse project we provide for this tutorial contains the LBLDURATION project, which is a native COBOL project.

The project also contains the lblduration.cbl program, which is a COBOL SQL program that converts calculations.

The demonstration Eclipse project and its components are located in the $COBDIR/demo/sql/hcopg/lblduration directory by default.

Sequence

To complete this tutorial, progress through these topics in the order presented here. The bottom of each topic provides Next topic and Previous topic navigational links to help you proceed in the proper sequence: