Embedded SQL in COBOL Applications - Assessment and Migration

COBOL applications can access databases using embedded SQL statements. Each SQL statement in a COBOL program begins with EXEC SQL and ends with END-EXEC.

For example:

 EXEC SQL
   -- SQL statement here
 END-EXEC.

Between the EXEC SQL and END-EXEC statements, you can use SQL statements only, COBOL statements are not allowed within this block.

SQL statements are written using the database native syntax.

For example (Informix):

 EXEC SQL
   DECLARE cur CURSOR FOR SELECT nvl(id,0) FROM a WHERE cur_date < today
 END-EXEC.

In this example, the SQL SELECT statement uses Informix NVL() function and TODAY operator that are invalid in SQL Server i.e.

Conversion Tasks

After you have converted the database, you need to assess COBOL applications and find out if there are any embedded SQL statements that are not valid anymore to access the new database.

If such SQL statements exist, they need to be converted to conform to the syntax of the new database.

How SQLines Tool Can Help

Using SQLines you can perform assessment and migration of embedded SQL statements in COBOL applications.

Services

We also offer services to convert your COBOL applications at highly competitive and reasonable fixed price. For more information, see Services