Skip to content

Getting Started

To work with the Getting Started application you must first set up an ODBC data source for the database of your choice. You will need to know the ODBC Data Source Name (DSN) and a valid UserID and Password for the DSN that is able to create and drop tables.

When working with PostgreSQL you must set the following ODBC options in your environment:

  • UpdatableCursors=0
  • UseDeclareFetch=1

On Linux you must include the ODBC shared object location in LD_LIBRARY_PATH. For example, if the unixODBC driver manager is installed in its default location, this will be:

 export LD_LIBRARY_PATH=/usr/local/lib:\$LD_LIBRARY_PATH

The Getting Started application, sample.cbl, can be found in the following locations:

  • Windows: %COBOLITDIR%\samples\sql
  • Linux: $COBOLITDIR/samples/sql

The application executes a series of SQL statements. Open sample.cbl in a text editor of your choice to view these statements. Comments in the source code provide information about alternative methods for opening the database connection.

To work with the application, open a command line window and execute the appropriate cobol-itsetup script for your environment (see the Installing COBOL-IT section of the COBOL-IT Compiler Suite, Getting Started With Compiler Suite guide for more details). Then change the directory to the SQL sample directory.


Back to top