Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


SQL

Use the SQL compiler option to enable the DB2 coprocessor capability and to specify DB2 suboptions. You must specify the SQL option if a COBOL source program contains SQL statements and it has not been processed by the DB2 precompiler.

Read syntax diagramSkip visual syntax diagram
SQL option syntax

   .-NOSQL-----------------------------.   
>>-+-----------------------------------+-----------------------><
   '-SQL--+--------------------------+-'   
          '-("DB2-suboption-string")-'     

Default is: NOSQL

Abbreviations are: None

When you use the SQL option, the DB2 coprocessor writes the database request module (DBRM) to ddname DBRMLIB. DB2 must be available on the machine on which you compile.

If you specify the NOSQL option, any SQL statements found in the source program are diagnosed and discarded.

Use either quotation marks or single quotation marks to delimit the string of DB2 suboptions.

You can partition a long suboption string into multiple suboption strings in multiple CBL statements. For example:

//STEP1 EXEC IGYWC, . . .
// PARM.COBOL='SQL("string1")'
//COBOL.SYSIN DD *
       CBL SQL("string2")
       CBL SQL('string3')
       IDENTIFICATION DIVISION.
       PROGRAM-ID. DRIVER1.
       . . .

The DB2 suboptions are concatenated in the order of their appearance. Thus in the example above, the compiler passes the following suboption string to the DB2 coprocessor:

"string1 string2 string3"

The concatenated strings are delimited with single spaces as shown. If multiple instances of the same DB2 option are found, the last specification of each option prevails. The compiler limits the length of the concatenated DB2 suboptions string to 4 KB.

related references  
Conflicting compiler options


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)