Using the Db2 precompiler to assist you in converting an external SQL procedure to a native SQL procedure
The Db2 precompiler can be useful when considering any conversion of an external SQL procedure to a native SQL procedure.
About this task
Procedure
To inspect the quality of native SQL PL source coding using the Db2 precompiler:
- Copy the original SQL PL source code to a FB80 data set. Reformat the source as needed to fit within the precompiler margins.
- Precompile the SQL PL source by executing program DSNHPSM with the HOST(SQLPL) option.
- Inspect the produced listing (SYSPRINT). Pay attention to error and warning messages.
- Modify the SQL PL source to address coding problems that are identified by messages in the listing.
- Repeat steps 1 - 4 until all error and warning messages are resolved. Then address informational messages as needed.
- Copy the modified SQL PL source file back to its original source format, reformatting as needed.