You need to consider specific options when using PL/I SQL support. The following table describes these considerations.
| If the target system is... | Use this compile-time option... |
|---|---|
| Windows using DB2 for Windows in native mode | DEFAULT (ASCII NATIVE IEEE) |
| CICS using DB2 for Windows in native mode | DEFAULT (ASCII NATIVE IEEE) |
| CICS VS/86 using DB2 for Windows in z/OS emulation mode | DEFAULT (EBCDIC NONNATIVE HEXADEC) |
| IMS using DB2 for Windows in z/OS emulation mode | DEFAULT (EBCDIC NONNATIVE HEXADEC) |
| ISPF dialog manager using DB2 for Windows in z/OS emulation mode | DEFAULT (EBCDIC NONNATIVE) |
When you have EXEC SQL statements in your PL/I source program, use the PP(SQL) option to process those statements:
pp(sql('option-string'))In the preceding example, 'option-string' is a character string enclosed in quotes. For example, pp(sql('dbname(Sample)') tells the preprocessor to work with the SAMPLE database.
If you are using EXEC SQL statements in your program, you must specify the SQL library in addition to the other link libraries in the linking command, for example:
ilink myprog.obj db2api.lib
You must have DB2 Universal Database for Windows installed and started before you can compile a program containing EXEC SQL statements. To find out how to install DB2, refer to database installation guide for the platform you are using.
You can start the database manager by issuing the following at a command prompt:
db2start