Command reference / prog

CRTSQLCBLI

Create SQL ILE COBOL Object

The Create SQL ILE COBOL Object (CRTSQLCBLI) command calls the Structured Query Language (SQL) precompiler which precompiles COBOL source containing SQL statements, produces a temporary source member, and then optionally calls the ILE COBOL compiler to create a module, create a program, or create a service program.

Allowed environments: *ALL. Positional parameters: 3.

Parameters

OBJ Object

Specifies the object to be created. This is a required parameter.

Type
*QUAL
Required
Yes
Case
Uppercase
name (Object)
Specify the name of the object to be created.
*CURLIB
The new object is created in the current library for the job. If no library is specified as the current library for the job, the QGPL library is used.
name (Library)
Specify the name of the library where the object is created.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Object Object

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*CURLIB
Length
10
Case
Uppercase

Suggested / special values: *CURLIB

SRCFILE Source file

Specifies the source file that contains the COBOL source statements and SQL statements.

Type
*QUAL
Required
No
Case
Uppercase
QCBLLESRC
Source file QCBLLESRC contains the COBOL source.
name (Source file)
Specify the name of the source file that contains the COBOL source. This source file should have a record length of 92. The source file can be a database file, device file, or an inline data file.
*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name (Library)
Specify the name of the library to be searched.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Source file Source file

Type
*NAME
Required
No
Default
QCBLLESRC
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

SRCMBR Source member

Specifies the source file member that contains the input source. This parameter is used only if the source file specified for the Source file (SRCFILE) parameter is a database file.

Type
*NAME
Required
No
Default
*OBJ
Length
10
Case
Uppercase

Suggested / special values: *OBJ

*OBJ
The source file member that has the same name as the value specified for the Object (OBJ) parameter contains the input source.
name
Specify the name of the source file member that contains the input source.

SRCSTMF Source stream file

Specifies the path name to the file that contains the COBOL source statements and SQL statements. The path name can be either absolute or relative. Source text must be in positions 1 to 80. Characters after position 80 will be ignored.

Type
*CHAR
Required
No
Length
5000
Case
Mixed case

COMMIT Commitment control

Specifies whether SQL statements in the compiled program are run under commitment control. Files referred to in the host language source are not affected by this option. Only SQL tables, SQL views, SQL packages, SQL sequences, SQL aliases, SQL Types, SQL procedures, SQL functions, SQL indexes, SQL schemas, SQL triggers, and SQL views referred to in SQL statements are affected.

Type
*CHAR
Required
No
Default
*CHG
Length
5
Case
Uppercase

Allowed values: *CHG, *ALL, *CS, *NONE, *RR, *UR, *RS, *NC

*CHG
Specifies the objects referred to in SQL ALTER, CALL, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, RENAME, and REVOKE statements and the rows updated, deleted, and inserted are locked until the end of the unit of work (transaction). Uncommitted changes in other jobs can be seen.
*UR
Specifies the objects referred to in SQL ALTER, CALL, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, RENAME, and REVOKE statements and the rows updated, deleted, and inserted are locked until the end of the unit of work (transaction). Uncommitted changes in other jobs can be seen.
*CS
Specifies the objects referred to in SQL ALTER, CALL, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, RENAME, and REVOKE statements and the rows updated, deleted, and inserted are locked until the end of the unit of work (transaction). A row that is selected, but not updated, is locked until the next row is selected. Uncommitted changes in other jobs cannot be seen.
*ALL
Specifies the objects referred to in SQL ALTER, CALL, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, RENAME, and REVOKE statements and the rows selected, updated, deleted, and inserted are locked until the end of the unit of work (transaction). Uncommitted changes in other jobs cannot be seen.
*RS
Specifies the objects referred to in SQL ALTER, CALL, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, RENAME, and REVOKE statements and the rows selected, updated, deleted, and inserted are locked until the end of the unit of work (transaction). Uncommitted changes in other jobs cannot be seen.
*NONE
Specifies that commitment control is not used. Uncommitted changes in other jobs can be seen. If the SQL DROP SCHEMA statement is included in the program, *NONE or *NC must be used. If a relational database is specified for the Relational database (RDB) parameter, and the relational database is on a system that is not on IBM i, *NONE or *NC cannot be specified.
*NC
Specifies that commitment control is not used. Uncommitted changes in other jobs can be seen. If the SQL DROP SCHEMA statement is included in the program, *NONE or *NC must be used. If a relational database is specified for the Relational database (RDB) parameter, and the relational database is on a system that is not on IBM i, *NONE or *NC cannot be specified.
*RR
Specifies the objects referred to in SQL ALTER, CALL, COMMENT ON, CREATE, DROP, GRANT, LABEL ON, RENAME, and REVOKE statements and the rows selected, updated, deleted, and inserted are locked until the end of the unit of work (transaction). Uncommitted changes in other jobs cannot be seen. All tables referred to in SELECT, UPDATE, DELETE, and INSERT statements are locked exclusively until the end of the unit of work (transaction).

RDB Relational database

Specifies the name of the relational database where the SQL package is to be created.

Type
*NAME
Required
No
Default
*LOCAL
Length
18
Case
Uppercase

Suggested / special values: *LOCAL, *NONE

*LOCAL
The program is created as a distributed SQL program. The SQL statements will access the local database. An SQL package object is not created as part of the precompile process. The Create Structured Query Language Package (CRTSQLPKG) command can be used.
*NONE
An SQL package object is not created. The program object is not a distributed program and the Create Structured Query Language Package (CRTSQLPKG) command cannot be used.
name
Specify the name of the relational database where the new SQL package object is to be created. When the name of the local relational database is specified, the program created is still a distributed SQL program. The SQL statements will access the local database.

OBJTYPE Compile type

Specifies the type of object to be created. When OBJTYPE(*PGM) or OBJTYPE(*SRVPGM) is specified and the Relational database (RDB) parameter is also specified, the CRTSQLPKG command is issued by the SQL precompiler after the program has been created. When OBJTYPE(*MODULE) is specified, an SQL package is not created and you must issue the CRTSQLPKG command after the CRTPGM or CRTSRVPGM command has created the program. If OPTION(*NOGEN) is specified, only the SQL temporary source member is generated. No module, program, service program, or SQL package is created. Note: If *SRVPGM is specified, there must be a source member in source file QSRVSRC that has the same name as the name specified for the Object (OBJ) parameter. The source member must contain the export information for the module.

Type
*CHAR
Required
No
Default
*PGM
Length
7
Case
Uppercase

Allowed values: *PGM, *SRVPGM, *MODULE

*PGM
The SQL precompiler calls the compiler to create a program.
*MODULE
The SQL precompiler calls the compiler to create a module.
*SRVPGM
The SQL precompiler calls the compiler to create a module and issues the Create Service Program (CRTSRVPGM) command to create a service program.

OUTPUT Listing output

Specifies whether the precompiler listing is generated.

Type
*CHAR
Required
No
Default
*NONE
Length
6
Case
Uppercase

Allowed values: *NONE, *PRINT

*NONE
The precompiler listing is not generated.
*PRINT
The precompiler listing is generated.

TEXT Text 'description'

Specifies text that briefly describes the program and its function.

Type
*CHAR
Required
No
Default
*SRCMBRTXT
Length
50
Case
Mixed case

Suggested / special values: *SRCMBRTXT, *BLANK

*SRCMBRTXT
The text is taken from the source file member being used to create the program. If the source file is an inline file or a device file, the text is blank.
*BLANK
No text is specified.
'description'
Specify no more than 50 characters, enclosed in apostrophes.

OPTION Precompiler options

Specifies whether one or more of the following options are used when the COBOL source is precompiled. If an option is specified more than once, or if two options conflict, the last option specified is used. Cross reference options: Program creation options: Decimal point options: Naming convention options: Second-level message text options: SQL string delimiter options: COBOL string delimiter options: LOB optimization for DRDA options: Event file creation options: Character string representations options: Extended indicators options: System time sensitive options:

Type
*CHAR
Required
No
Default
*XREF
Length
10
List limit
18
Case
Uppercase

Allowed values: *XREF, *NOXREF, *GEN, *NOGEN, *COMMA, *PERIOD, *JOB, *SYSVAL, *SECLVL, *NOSECLVL, *EVENTF, *NOEVENTF, *CVTDT, *NOCVTDT, *SQL, *SYS, *OPTLOB, *NOOPTLOB, *NOEXTIND, *EXTIND, *SYSTIME, *NOSYSTIME, *QUOTESQL, *APOSTSQL, *QUOTE, *APOST

*XREF
The precompiler cross-references items in the program to the statement numbers in the program that refer to those items. This information is generated as part of the precompiler listing.
*NOXREF
The precompiler does not cross-reference names.
*GEN
The precompiler creates the object that is specified for the Compile type (OBJTYPE) parameter.
*NOGEN
The precompiler does not call the ILE COBOL compiler. No module, program, service program, or SQL package is created.
*JOB
The representation for the decimal point specified for the job at precompile time is used. Note: If QDECFMT specifies that the value used as the decimal point is a comma, any numeric constants in lists (such as in the SELECT clause and VALUES clause) must be separated by a comma followed by a blank. For example, VALUES(1,1, 2,23, 4,1) is equivalent to VALUES(1.1,2.23,4.1) where the decimal point is the period.
*SYSVAL
The value used as the decimal point in numeric constants is from the QDECFMT system value. This value is also used as the decimal point character when casting a numeric value to character. Note: If QDECFMT specifies that the value used as the decimal point is a comma; any numeric constants in lists (such as in the SELECT clause and VALUES clause) must be separated by a comma followed by a blank. For example, VALUES(1,1, 2,23, 4,1) is equivalent to VALUES(1.1,2.23,4.1) where the decimal point is the period.
*PERIOD
The value used as the decimal point for numeric constants used in SQL statements is a period. This value is also used as the decimal point character when casting a numeric value to character.
*COMMA
The value used as the decimal point in numeric constants is a comma. Any numeric constants in lists (such as in the SELECT clause and VALUES clause) must be separated by a comma followed by a blank. For example, VALUES(1,1, 2,23, 4,1) is equivalent to VALUES(1.1,2.23,4.1) where the decimal point is the period.
*SYS
Specifies that the system naming convention is used (library-name/file-name).
*SQL
Specifies that the SQL naming convention is used (schema-name.table-name). If a relational database is specified for the Relational database (RDB) parameter, and the database is on a system that is not IBM i, *SQL must be specified as the naming convention.
*NOSECLVL
Second-level text descriptions are not added to the listing.
*SECLVL
Second-level text with replacement data is added for all messages on the listing.
*QUOTESQL
The character used as the string delimiter in the SQL statements is the quote (").
*APOSTSQL
The character used as the string delimiter in the SQL statements is the apostrophe (').
*QUOTE
The character used for nonnumeric literals and Boolean literals in the COBOL statements is the quote (").
*APOST
The character used for nonnumeric literals and Boolean literals in the COBOL statements is the apostrophe (').
*OPTLOB
The first FETCH for a cursor determines how the cursor will be used for LOBs (Large Objects) and XML on all subsequent FETCHes. This option remains in effect until the cursor is closed. If the first FETCH uses a LOB or XML locator to access a LOB or XML column, no subsequent FETCH for that cursor can fetch that LOB or XML column into a LOB or XML host variable. If the first FETCH places the LOB or XML column into a LOB or XML host variable, no subsequent FETCH for that cursor can use a LOB or XML locator for that column.
*NOOPTLOB
There is no restriction on whether a column is retrieved into a LOB or XML locator or into a LOB or XML host variable. This option can cause performance to degrade.
*NOEVENTF
The compiler will not produce an Event File for use by client tooling.
*EVENTF
The compiler produces an Event File for use by client tooling. The Event File will be created as a member in the file EVFEVENT in your object library. Client tooling uses this file to provide integrated error feedback. This option is normally specified by client tooling on your behalf. Note: Client tooling may not work properly if this option is used and OBJTYPE(*SRVPGM) is also specified. Low severity messages generated by the SQL precompiler or compiler may be lost by client tooling.
*NOCVTDT
Specifies that date, time, and timestamp data types which are retrieved from externally-described database files are to be processed using the date, time, and timestamp data types.
*CVTDT
Specifies that date, time and timestamp data types, which are retrieved from externally-described database files, are to be processed as fixed-length character fields.
*NOEXTIND
Extended indicator support is not enabled.
*EXTIND
Extended indicator support is enabled.
*SYSTIME
Specifies that references to system-period temporal tables in both static and dynamic SQL statements are affected by the value of the CURRENT TEMPORAL SYSTEM_TIME special register.
*NOSYSTIME
Specifies that references to system-period temporal tables in both static and dynamic SQL statements are not affected by the value of the CURRENT TEMPORAL SYSTEM_TIME special register.

TGTRLS Target release

Specifies the release of the operating system on which you intend to use the object being created. When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V5R3M0 is version 5, release 3, modification 0. Valid values depend on the current version, release, and modification level of the operating system, and they change with each new release. You can press F4 while prompting this command parameter to see a list of valid target release values.

Type
*NAME
Required
No
Default
*CURRENT
Length
10
Case
Uppercase

Suggested / special values: *CURRENT, *PRV

*CURRENT
The object is to be used on the release of the operating system currently running on your system. The object can also be used on a system with any subsequent release of the operating system installed.
*PRV
The object is to be used on the previous release with modification level 0 of the operating system. The object can also be used on a system with any subsequent release of the operating system installed.
target-release
Specify the release in the format VxRxMx. The object can be used on a system with the specified release or with any subsequent release of the operating system installed.

INCFILE INCLUDE file

Specifies the source file that contains members to be included in the program with the SQL INCLUDE statement.

Type
*QUAL
Required
No
Case
Uppercase
*SRCFILE
The qualified source file you specify for the Source file (SRCFILE) parameter contains the source file members specified on any SQL INCLUDE statements.
name (INCLUDE file)
Specify the name of the source file that contains the source file members specified on any SQL INCLUDE statements. The record length of the source file you specify here must be no less than the record length of the source file you specify for the Source file (SRCFILE) parameter.
*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name (Library)
Specify the name of the library where the source file is located.
Qualified parts (object, then library; write LIBRARY/OBJECT)

INCLUDE file INCLUDE file

Type
*NAME
Required
No
Default
*SRCFILE
Length
10
Case
Uppercase

Suggested / special values: *SRCFILE

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

ALWCPYDTA Allow copy of data

Specifies whether a copy of the data can be used in a SELECT statement.

Type
*CHAR
Required
No
Default
*OPTIMIZE
Length
9
Case
Uppercase

Allowed values: *OPTIMIZE, *YES, *NO

*OPTIMIZE
The system determines whether to use the data retrieved directly from the database or to use a copy of the data. The decision is based on which method provides the best performance. If the Commitment control (COMMIT) parameter is not *NONE, the Allow blocking (ALWBLK) parameter should be set to *ALLREAD, when possible, for best performance.
*YES
A copy of the data is used only when necessary.
*NO
A copy of the data is not used. If a temporary copy of the data is required to perform the query, an error message is returned.

CLOSQLCSR Close SQL cursor

Specifies when SQL cursors are implicitly closed, SQL prepared statements are implicitly discarded, and LOCK TABLE locks are released. SQL cursors are explicitly closed when the user issues the CLOSE, COMMIT, or ROLLBACK (without HOLD) SQL statements.

Type
*CHAR
Required
No
Default
*ENDACTGRP
Length
10
Case
Uppercase

Allowed values: *ENDACTGRP, *ENDMOD

*ENDACTGRP
SQL cursors are closed and SQL prepared statements are implicitly discarded, and LOCK TABLE locks are released when the activation group ends.
*ENDMOD
SQL cursors are closed and SQL prepared statements are implicitly discarded when the module is exited. LOCK TABLE locks are released when the first SQL program on the call stack ends. Note that a cursor may only be logically closed and will only be physically closed when the first program with SQL leaves the stack and only if that program was not compiled with *ENDACTGRP.

ALWBLK Allow blocking

Specifies whether the database manager can use record blocking and the extent to which blocking can be used for read-only cursors.

Type
*CHAR
Required
No
Default
*ALLREAD
Length
8
Case
Uppercase

Allowed values: *ALLREAD, *NONE, *READ

*ALLREAD
Rows are blocked for read-only cursors. All cursors in a program that are not explicitly able to be changed are opened for read-only processing even though there may be EXECUTE or EXECUTE IMMEDIATE statements in the program. Specifying *ALLREAD: Allows record blocking for all read-only cursors. Can improve the performance of almost all read-only cursors in programs, but limits queries in the following ways: The Rollback (ROLLBACK) command, a ROLLBACK statement in host languages, or the ROLLBACK HOLD SQL statement does not reposition a read-only cursor when *ALLREAD is specified. Dynamic running of a positioned UPDATE or DELETE statement (for example, using EXECUTE IMMEDIATE), can not be used to update a row in a cursor unless the DECLARE statement for the cursor includes the FOR UPDATE clause.
*NONE
Rows are not blocked for retrieval of data for cursors. Specifying *NONE: Guarantees that the data retrieved is current. May reduce the amount of time required to retrieve the first row of data for a query. Stops the database manager from retrieving a block of data rows that is not used by the program when only the first few rows of a query are retrieved before the query is closed. Can degrade the overall performance of a query that retrieves a large number of rows.
*READ
Records are blocked for read-only retrieval of data for cursors when: *NONE is specified for the Commitment control (COMMIT) parameter, which indicates that commitment control is not used. The cursor is declared with a FOR READ ONLY clause or there are no dynamic statements that could run a positioned UPDATE or DELETE statement for the cursor.

DLYPRP Delay PREPARE

Specifies whether the dynamic statement validation for a PREPARE statement is delayed until an OPEN, EXECUTE, or DESCRIBE statement is run. Delaying validation improves performance by eliminating redundant validation.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Dynamic statement validation is not delayed. When the dynamic statement is prepared, the access plan is validated. When the dynamic statement is used in an OPEN or EXECUTE statement, the access plan is revalidated. Because the authority or the existence of objects referred to by the dynamic statement may change, you must still check the SQLCODE or SQLSTATE after issuing the OPEN or EXECUTE statement to ensure that the dynamic statement is still valid.
*YES
Dynamic statement validation is delayed until the dynamic statement is used in an OPEN, EXECUTE, or DESCRIBE SQL statement. When the dynamic statement is used, the validation is completed and an access plan is built. If you specify *YES for this parameter for precompiled programs, you should check the SQLCODE and SQLSTATE after running an OPEN, EXECUTE, or DESCRIBE statement to ensure that the dynamic statement is valid. Note: If you specify *YES, performance is not improved if the INTO clause is used on the PREPARE statement or if a DESCRIBE statement uses the dynamic statement before an OPEN is issued for the statement.

CONACC Concurrent access resolution

Specifies how the database manager should handle record lock conflicts for data in the process of being updated.

Type
*CHAR
Required
No
Default
*DFT
Length
7
Case
Uppercase

Allowed values: *DFT, *CURCMT, *WAIT

*DFT
Specifies that the concurrent access option will not be explicitly set for this program. The value that is in effect when the program is invoked will be used. The value can be set using the SQL_CONCURRENT_ACCESS_RESOLUTION option in the query options file QAQQINI.
*CURCMT
Directs the database manager to use the currently committed data when possible in the case of record lock conflicts for read-only queries. This only applies when the commit level is *CS.
*WAIT
Directs the database manager to wait for the outcome in the case of record lock conflicts.

GENLVL Severity level

Specifies whether the compiler is called, depending on the severity of messages generated as a result of errors found by the SQL precompiler. If precompiler errors are generated that have a message severity level greater than the value specified for this parameter, the compiler is not called. If the Relational database (RDB) parameter is specified and the severity of the messages generated as a result of package creation is greater than the severity level specified for this parameter, the SQL package is not created.

Type
*UINT2
Required
No
Default
10
Range
0 to 40
Case
Uppercase
10
Do not call the compiler if SQL precompiler messages with a message severity greater than 10 are generated.
0-40
Specify the maximum SQL precompiler message severity level to be used to control whether the compiler is called.

DATFMT Date format

Specifies the format used when accessing date result columns. All output date fields are returned in the format you specify. For input date strings, the value you specify is used to determine whether the date is a valid format. Note: An input date string that uses the format *USA, *ISO, *EUR, or *JIS is always valid. If you connect to a relational database that is on a system that is not IBM i, the format must be *USA, *ISO, *EUR, or *JIS.

Type
*CHAR
Required
No
Default
*JOB
Length
4
Case
Uppercase

Allowed values: *JOB, *USA, *ISO, *EUR, *JIS, *MDY, *DMY, *YMD, *JUL

*JOB
The format specified for the job at precompile time or when a new interactive SQL session is created is used. Use the Display Job (DSPJOB) command to determine the current date format for the job.
*USA
The United States date format mm/dd/yyyy is used.
*ISO
The International Organization for Standardization (ISO) date format yyyy-mm-dd is used.
*EUR
The European date format dd.mm.yyyy is used.
*JIS
The Japanese Industrial Standard date format yyyy-mm-dd is used.
*MDY
The date format mm/dd/yy is used.
*DMY
The date format dd/mm/yy is used.
*YMD
The date format yy/mm/dd is used.
*JUL
The Julian date format yy/ddd is used.

DATSEP Date separator character

Specifies the separator to be used when accessing date result columns. Note: This parameter applies only when *JOB, *MDY, *DMY, *YMD, or *JUL is specified for the Date format (DATFMT) parameter.

Type
*CHAR
Required
No
Default
*JOB
Length
6
Case
Uppercase

Suggested / special values: /, ., ,, -, , *JOB, *BLANK

*JOB
The date separator specified for the job at precompile time, when a new interactive SQL session is created, or when Run SQL Statement (RUNSQLSTM) command is run. Use the Display Job (DSPJOB) command to determine the current date separator value for the job.
'/'
A slash is used as the date separator.
'.'
A period is used as the date separator.
'-'
A dash is used as the date separator.
','
A comma is used as the date separator.
' '
A blank is used as the date separator.
*BLANK
A blank is used as the date separator.

TIMFMT Time format

Specifies the format used when accessing time result columns. All output time fields are returned in the format you specify. For input time strings, the value you specify is used to determine whether the time is specified in a valid format. Note: An input time string that uses the format *USA, *ISO, *EUR, or *JIS is always valid. If you connect to a relational database that is on a system that is not another IBM i, the time format must be *USA, *ISO, *EUR, *JIS, or *HMS with a time separator of a colon or period.

Type
*CHAR
Required
No
Default
*HMS
Length
4
Case
Uppercase

Allowed values: *HMS, *USA, *ISO, *EUR, *JIS

*HMS
The hh:mm:ss format is used.
*USA
The United States time format hh:mm xx is used, where xx is AM or PM.
*ISO
The International Organization for Standardization (ISO) time format hh.mm.ss is used.
*EUR
The European time format hh.mm.ss is used.
*JIS
The Japanese Industrial Standard time format hh:mm:ss is used.

TIMSEP Time separator character

Specifies the separator used when accessing time result columns. Note: This parameter applies only when *HMS is specified for the Time format (TIMFMT) parameter.

Type
*CHAR
Required
No
Default
*JOB
Length
6
Case
Uppercase

Suggested / special values: :, ., ,, , *JOB, *BLANK

*JOB
The time separator specified for the job at precompile time, when a new interactive SQL session is created, or when RUNSQLSTM is run is used. Use the Display Job (DSPJOB) command to determine the current time separator value for the job.
':'
A colon is used as the time separator.
'.'
A period is used as the time separator.
','
A comma is used as the time separator.
' '
A blank is used as the time separator.
*BLANK
A blank is used as the time separator.

REPLACE Replace

Specifies if a SQL module, program, service program or package is created when there is an existing SQL module, program, service program, or package of the same name and type in the same library. The value for this parameter is passed to the CRTCBLMOD, CRTBNDCBL, CRTSRVPGM, and CRTSQLPKG commands.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

Allowed values: *YES, *NO

*YES
A new SQL module, program, service program, or package is created, any existing SQL object of the same name and type in the specified library is moved to QRPLOBJ.
*NO
A new SQL module, program, service program, or package is not created if an SQL object of the same name and type already exists in the specified library.

DFTRDBCOL Default collection

Specifies the name of the schema identifier used for the unqualified names of the tables, views, indexes, SQL packages, aliases, constraints, external programs, node groups, and triggers. This parameter applies only to static SQL statements.

Type
*NAME
Required
No
Default
*NONE
Length
10
Case
Uppercase

Suggested / special values: *NONE

*NONE
The naming convention specified for the Precompiler options (OPTION) parameter is used.
name
Specify the name of the schema identifier to be used instead of the naming convention specified for the Precompiler options (OPTION) parameter.

SQLCURRULE SQL rules

Specifies the semantics used for SQL statements.

Type
*CHAR
Required
No
Default
*DB2
Length
4
Case
Uppercase

Allowed values: *DB2, *STD

*DB2
The semantics of all SQL statements will default to the rules established for Db2. The following semantics are controlled by this option: Hexadecimal constants are treated as character data. Unicode graphic-string constants are UCS-2 (CCSID 13488). Assignments to SQL-variables and SQL-parameters within the body of a routine or a trigger will use retrieval assignment rules. When describing a select statement into an SQLDA and SQLN is smaller than the required number of SQLVAR entries, SQLSTATE 01005 is returned only when the result table contains LOBs or UDTs.
*STD
The semantics of all SQL statements will default to the rules established by the ISO and ANSI SQL standards. The following semantics are controlled by this option: Hexadecimal constants are treated as binary data. Unicode graphic-string constants are UTF-16 (CCSID 1200). Assignments to SQL-variables and SQL-parameters within the body of a routine or a trigger will use storage assignment rules. When describing a select statement into an SQLDA and SQLN is smaller than the required number of SQLVAR entries, SQLSTATE 01005 is always returned.

PRTFILE Print file

Specifies the printer device file to be used for the precompiler output listing.

Type
*QUAL
Required
No
Case
Uppercase
QSYSPRT
The precompiler output file is directed to the IBM-supplied printer file, QSYSPRT. The file QSYSPRT has a record length of 132. If you specify a file whose record length is less than 132, information is lost.
name (Print file)
Specify the name of the printer device file to which the precompiler output is directed.
*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name (Library)
Specify the name of the library where the printer file is located.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Print file Print file

Type
*NAME
Required
No
Default
QSYSPRT
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

DBGVIEW Debugging view

Specifies the type of source debug information to be provided by the SQL precompiler.

Type
*CHAR
Required
No
Default
*NONE
Length
7
Case
Uppercase

Allowed values: *NONE, *SOURCE, *STMT, *LIST

*NONE
No debug view information is generated.
*SOURCE
The SQL precompiler will provide the source views for the root and if necessary, SQL INCLUDE statements. A view is to be provided which contains the statements generated by the precompiler.
*STMT
Allows the compiled object to be debugged using program statement numbers and symbolic identifiers.
*LIST
Generates the listing view for debugging the compiled object.

USRPRF User profile

Specifies the user profile that is used when the compiled program object and SQL package object is run, including the authority that the program object or SQL package has for each object in static SQL statements. The profile of either the owner or the user is used to control access to objects.

Type
*CHAR
Required
No
Default
*NAMING
Length
7
Case
Uppercase

Allowed values: *NAMING, *USER, *OWNER

*NAMING
The user profile is determined by the naming convention. If the naming convention is *SQL, USRPRF(*OWNER) is used. If the naming convention is *SYS, USRPRF(*USER) is used.
*USER
The profile of the user running the program or SQL package is used.
*OWNER
The user profiles of both the owner and the user are used when the program or SQL package is run.

DYNUSRPRF Dynamic user profile

Specifies the user profile used for dynamic SQL statements.

Type
*CHAR
Required
No
Default
*USER
Length
6
Case
Uppercase

Allowed values: *USER, *OWNER

*USER
Local dynamic SQL statements are run under the profile of the program's user. Distributed dynamic SQL statements are run under the profile of the application server job.
*OWNER
Local dynamic SQL statements are run under the profile of the program's owner. Distributed dynamic SQL statements are run under the profile of the SQL package's owner.

LANGID Language id

Specifies the language identifier to be used when SRTSEQ(*LANGIDUNQ) or SRTSEQ(*LANGIDSHR) is specified.

Type
*CHAR
Required
No
Default
*JOB
Length
8
Case
Uppercase

Suggested / special values: *JOB, *JOBRUN

*JOB
The LANGID value for the job is retrieved during the precompile.
*JOBRUN
The LANGID value for the job is retrieved when the program is run. For distributed applications, LANGID(*JOBRUN) is valid only when SRTSEQ(*JOBRUN) is also specified.
language-id
Specify the language identifier to be used by the program.

CVTCCSID Conversion CCSID

The CCSID used for conversion when a UTF-8 source stream file is provided on the Source stream file (SRCSTMF) parameter. Otherwise, this parameter is ignored.

Type
*INT4
Required
No
Default
*NONE
Range
1 to 65534
Case
Uppercase

Suggested / special values: *NONE, *JOB

*NONE
No conversion CCSID is provided.
*JOB
The source is converted to the default job CCSID.
1-65534
The source is converted to the specified CCSID. The CCSID must be a single-byte or mixed-byte EBCDIC CCSID.

TOSRCFILE To source file

Specifies the source file that is to contain the output source member that has been processed by the SQL precompiler. If the specified source file is not found, it will be created. The output member will have the same name as the name specified for the Object (OBJ) or Program (PGM) parameter.

Type
*QUAL
Required
No
Case
Uppercase
QSQLTEMP
The source file QSQLTEMP will be used.
name (To source file)
Specify the name of the source file to contain the output source member.
QTEMP
The library QTEMP will be used.
*LIBL
The job's library list is searched for the specified file. If the file is not found in any library in the library list, the file will be created in the current library.
*CURLIB
The current library for the job will be used. If no library is specified as the current library for the job, the QGPL library is used.
name (Library)
Specify the name of the library that is to contain the output source file.
Qualified parts (object, then library; write LIBRARY/OBJECT)

To source file To source file

Type
*NAME
Required
No
Default
QSQLTEMP
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
QTEMP
Length
10
Case
Uppercase

Suggested / special values: QTEMP, *LIBL, *CURLIB

COMPILEOPT Compiler options

Specifies additional parameters to be used on the compiler command. The COMPILEOPT string is added to the compiler command built by the precompiler. If INCDIR( is anywhere in the string, the precompiler will call the compiler using the SRCSTMF parameter. There is no validation of the string. The compiler command will issue an error if any parameter is incorrect. Please refer to the DB2 for i SQL programming topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for a list of parameters that the precompiler generates for the compiler command. Using any of the keywords that the precompiler passes to the compiler will cause the compiler command to fail because of duplicate parameters.

Type
*CHAR
Required
No
Default
*NONE
Length
5000
Case
Mixed case

Suggested / special values: *NONE

*NONE
No additional parameters will be used on the compiler command.
character-value
Specify no more than 5000 characters, enclosed in apostrophes.

Examples

CRTSQLCBLI OBJ(PAYROLL) OBJTYPE(*MODULE) TEXT('Payroll Program')

This command runs the SQL precompiler which precompiles the COBOL source and stores the changed source in member PAYROLL of source file QSQLTEMP in library QTEMP. The ILE COBOL compiler is called to create module PAYROLL in the current library by using the source member created by the SQL precompiler.

IBM command documentation

Generated from os/cl/catalog/CRTSQLCBLI.json and os/cl/help/CRTSQLCBLI.json.