The DB2® UDB Query Manager and SQL Development Kit licensed program has seven precompiler commands, one for each of the host languages.
Host language | Command |
---|---|
iSeries™ PL/I | CRTSQLPLI |
ILE C/400® language | CRTSQLCI |
COBOL/400® language | CRTSQLCBL |
ILE COBOL/400 language | CRTSQLCBLI |
FORTRAN/400 language | CRTSQLFTN |
RPG III (part of RPG/400® language) | CRTSQLRPG |
ILE RPG/400 language | CRTSQLRPGI |
A separate command for each language exists so each language can have parameters that apply only to that language. For example, the options *APOST and *QUOTE are unique to COBOL. They are not included in the commands for the other languages. The precompiler is controlled by parameters specified when it is called by one of the SQL precompiler commands. The parameters specify how the input is processed and how the output is presented.
You can precompile a program without specifying anything more than the name of the member containing the program source statements as the PGM parameter (for non-ILE precompiles) or the OBJ parameter (for ILE precompiles) of the CRTSQLxxx command. SQL assigns default values for all precompiler parameters (which might, however, be overridden by any that you explicitly specify).
The following example creates a COBOL program named INVENT and stores it in a library named SPIFFY. The SQL naming convention is selected, and every row selected from a specified table is locked until the end of the unit of recovery. An SQL package with the same name as the program is created on the remote relational database named KC000.
CRTSQLCBL PGM(SPIFFY/INVENT) OPTION(*SRC *XREF *SQL) COMMIT(*ALL) RDB(KC000)