Command reference / prog

CRTRPGMOD

Create RPG Module

Compiles ILE RPG source code to create a module object (*MODULE). You can use this command in either batch or interactive mode.

Allowed environments: *ALL. Positional parameters: 3.

Parameters

MODULE Module

Library and name of the module object to create. If the name is *CTLSPEC, it comes from DFTNAME on the control specification, or from the source member name for a database source, or defaults to RPGMOD.

Type
*QUAL
Required
No
Case
Uppercase
*CTLSPEC
Take the name from the control specification (DFTNAME) or the source member.
*CURLIB
Store in the current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Module Module

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

Suggested / special values: *CTLSPEC

Library Library

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

Suggested / special values: *CURLIB

SRCFILE Source file

Source file holding the ILE RPG member to compile, and its library. The recommended physical file record length is 112 characters.

Type
*QUAL
Required
No
Case
Uppercase
*LIBL
Search the library list for the source file's library.
*CURLIB
Use the current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Source file Source file

Type
*NAME
Required
No
Default
QRPGLESRC
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *LIBL, *CURLIB

SRCMBR Source member

Name of the source file member that holds the ILE RPG specifications to compile.

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

Suggested / special values: *MODULE

*MODULE
Use the MODULE name as the member name.

SRCSTMF Source stream file

Path name of the stream file that contains the ILE RPG source. Cannot be combined with SRCMBR or SRCFILE.

Type
*CHAR
Required
No
Length
50
Case
Uppercase

GENLVL Generation severity level

Highest compile error severity that still allows the module to be generated; 0 through 20, default 10. Errors above 20 never generate a module.

Type
*UINT2
Required
No
Default
10
Range
0 to 20
Case
Uppercase

TEXT Text 'description'

Text describing the module, up to 50 characters.

Type
*CHAR
Required
No
Default
*SRCMBRTXT
Length
50
Case
Uppercase

Suggested / special values: *SRCMBRTXT, *BLANK

*SRCMBRTXT
Use the text of the source member (default).
*BLANK
No text.

OPTION Compiler options

Options for compiling the source member. Up to 20 may be given, in any order; if one is repeated, the last one is used. Common values are listed here; the page lists more.

Type
*CHAR
Required
No
Length
10
List limit
20
Case
Uppercase

Allowed values: *XREF, *NOXREF, *GEN, *NOGEN, *SECLVL, *NOSECLVL, *SHOWCPY, *NOSHOWCPY, *EXPDDS, *NOEXPDDS, *EXT, *NOEXT, *NOSHOWSKP, *SHOWSKP, *NOSRCSTMT, *SRCSTMT, *DEBUGIO, *NODEBUGIO, *UNREF, *NOUNREF, *NOEVENTF, *EVENTF

*XREF
Produce a cross-reference listing where appropriate.
*NOXREF
No cross-reference listing.
*GEN
Create a module that can be bound if errors are within GENLVL.
*NOGEN
Do not create a module object.
*SECLVL
Print second-level message text in the Message Summary.
*NOSECLVL
Do not print second-level message text.
*SHOWCPY
Show source records of members included by /COPY.
*NOSHOWCPY
Do not show /COPY source records.
*EXPDDS
Show the expansion of externally described files and key field information.
*NOEXPDDS
Do not show the expansion or key field information.
*SRCSTMT
Statement numbers built from source ID and SEU sequence number.
*NOSRCSTMT
Sequential line numbers used for debugging.
*DEBUGIO
Generate breakpoints for all input and output specifications.
*NODEBUGIO
No breakpoints for input and output specifications.
*UNREF
Include unreferenced data items in the module.
*NOUNREF
Exclude unreferenced data items to save storage.
*NOEVENTF
No event file for client tooling.
*EVENTF
Create an event file for client tooling in EVFEVENT.

DBGVIEW Debugging views

Which debugging level and source views are available for the module.

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

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

*STMT
Debug by line numbers or statement numbers from the listing.
*SOURCE
Generate the source view.
*LIST
Generate the listing view.
*COPY
Generate the source and copy views.
*ALL
Generate the listing, source and copy views.
*NONE
Disable all debug options.

DBGENCKEY Debug encryption key

Key, 1 to 16 bytes, used to encrypt source embedded in debug views.

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

Suggested / special values: *NONE

*NONE
No encryption key.

OUTPUT Output

Whether a compiler listing is generated.

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

Allowed values: *PRINT, *NONE

*PRINT
Produce a compiler listing with source and compile-time messages.
*NONE
No compiler listing.

OPTIMIZE Optimization level

Level of optimization applied to the module.

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

Allowed values: *NONE, *BASIC, *FULL

*NONE
No optimization; fastest translation; variables can be displayed and modified in debug.
*BASIC
Some optimization; variables displayed but not modified in debug.
*FULL
Most efficient code; longest translation time.

INDENT Source listing indentation

Whether structured operations are indented in the source listing, and which characters mark the clauses. Up to 2 characters.

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

Suggested / special values: *NONE

*NONE
No indentation (default).

CVTOPT Type conversion options

How date, time, timestamp, graphic and variable-length types from externally described files are handled.

Type
*CHAR
Required
No
Default
*NONE
Length
11
List limit
4
Case
Uppercase

Allowed values: *NONE, *DATETIME, *GRAPHIC, *VARCHAR, *VARGRAPHIC

*NONE
Use native RPG date, time, timestamp and varying-length types.
*DATETIME
Date, time and timestamp types declared as fixed-length character.
*GRAPHIC
DBCS graphic types declared as fixed-length character.
*VARCHAR
Variable-length character types declared as fixed-length character.
*VARGRAPHIC
Variable-length DBCS graphic types declared as fixed-length character.

SRTSEQ Sort sequence

Sort sequence table used in the ILE RPG source program.

Type
*QUAL
Required
No
Case
Uppercase
*HEX
No sort sequence table.
*JOB
The job's SRTSEQ value when the module is created.
*JOBRUN
The job's SRTSEQ value when the module is run.
*LANGIDUNQ
Unique weighted table selected with LANGID.
*LANGIDSHR
Shared weighted table selected with LANGID.
*LIBL
Search the library list for the table.
*CURLIB
Search the current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Sort sequence Sort sequence

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *LIBL, *CURLIB

LANGID Language identifier

Language identifier used with a *LANGIDUNQ or *LANGIDSHR sort sequence. For example, FRA for French or DEU for German.

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

Suggested / special values: *JOBRUN, *JOB

*JOBRUN
The job's LANGID when the module is run.
*JOB
The job's LANGID when the module is created.

REPLACE Replace module

Whether a new module replaces an existing module of the same name in the library.

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

Allowed values: *YES, *NO

*YES
The existing module is moved to QRPLOBJ.
*NO
No new module is created if one of that name exists.

AUT Authority

Authority given to users with no specific authority, who are not on the authorization list, and whose group has no specific authority. Can be changed later with GRTOBJAUT or RVKOBJAUT.

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

Suggested / special values: *LIBCRTAUT, *ALL, *CHANGE, *USE, *EXCLUDE

*LIBCRTAUT
Take the CRTAUT value of the target library when created.
*ALL
All operations except those limited to the owner or AUTLMGT.
*CHANGE
All data authority and most operations.
*USE
Object operational and read authority; cannot change the module.
*EXCLUDE
No access.

TRUNCNBR Truncate numeric

Whether a truncated value is moved to the result field or a run-time error is generated on numeric overflow. Does not apply inside expressions.

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

Allowed values: *YES, *NO

*YES
Ignore overflow and move the truncated value.
*NO
A run-time error is generated on overflow.

FIXNBR Fix numeric

Whether invalid decimal data is fixed by the compiler.

Type
*CHAR
Required
No
Default
*NONE
Length
12
List limit
2
Case
Uppercase

Allowed values: *NONE, *ZONED, *INPUTPACKED

*NONE
Invalid decimal data causes run-time decimal errors.
*ZONED
Invalid zoned decimal data is fixed when converted to packed.
*INPUTPACKED
Invalid packed data read through input specifications is set to zero.

TGTRLS Target release

Operating system release on which the object will be used, in VxRxMx format. Valid values change with each release.

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

Suggested / special values: *CURRENT, *PRV

*CURRENT
The release running on the system; also usable on later releases.
*PRV
The previous release at modification level 0; also usable on later releases.

ALWNULL Allow null values

How the module handles records with null-capable fields from externally described database files.

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

Allowed values: *NO, *INPUTONLY, *USRCTL, *YES

*NO
Records with null values are not processed; a data-mapping error occurs.
*INPUTONLY
Input-only reads succeed and defaults replace nulls; no null key use or writes.
*USRCTL
Read, write and update null values; the programmer manages null handling.
*YES
Same as *INPUTONLY.

DEFINE Define condition names

Condition names defined before compilation starts; same as a /DEFINE directive on the first line. Up to 32, each up to 50 characters.

Type
*SNAME
Required
No
Default
*NONE
Length
10
List limit
32
Case
Uppercase

Suggested / special values: *NONE

*NONE
No condition names are defined.

ENBPFRCOL Enable performance collection

Whether performance statistics are gathered.

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

Allowed values: *PEP, *ENTRYEXIT, *FULL

*PEP
Gathered on entry and exit of the program entry procedure only (default).
*ENTRYEXIT
Gathered on entry and exit of all procedures.
*FULL
Gathered on entry and exit of all procedures, and before and after each external call.

PRFDTA Profiling data

Program profiling data attribute for the module, used to reorder procedures and code.

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

Allowed values: *NOCOL, *COL

*NOCOL
Not enabled to collect profiling data (default).
*COL
Enabled; only with *FULL optimization and target release *CURRENT.

STGMDL Storage model

Type of storage used by the module.

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

Allowed values: *INHERIT, *SNGLVL, *TERASPACE

*INHERIT
Adopts the storage model of its caller; can be bound into any storage model program.
*SNGLVL
Only bound into single-level storage programs and service programs.
*TERASPACE
Only bound into teraspace storage programs and service programs.

BNDDIR Binding directory

Binding directories used in symbol resolution when the module is bound at CRTPGM or CRTSRVPGM time.

Type
*QUAL
Required
No
Default
*NONE
List limit
50
Case
Uppercase

Suggested / special values: *NONE

*NONE
No binding directory.
*LIBL
Search the library list (default).
*CURLIB
Current library resolved at compile time; QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Binding directory Binding directory

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *LIBL, *CURLIB

LICOPT Licensed Internal Code options

One or more Licensed Internal Code compile-time options, intended for advanced programmers.

Type
*CHAR
Required
No
Default
X''
Length
50
Case
Uppercase

INCDIR Include directory

Directories added to the search path for copy files; up to 32. The source directory is always searched.

Type
*CHAR
Required
No
Default
*NONE
Length
50
List limit
32
Case
Uppercase

Suggested / special values: *NONE

*NONE
No user directories are searched.

PGMINFO Program interface information

Whether program interface information is generated, and where. Element 1 is Generate; element 2 is Location.

Type
*ELEM
Required
No
Case
Uppercase
*NO
Do not generate (default).
*PCML
Generate PCML so Java methods can call the module's procedures.
*STMF
Generate into the stream file named in INFOSTMF.
*MODULE
Store the information in the RPG module.
*ALL
Generate into the stream file and store it in the module.
Elements in order

Generate Generate

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

Allowed values: *NO, *PCML

Location Location

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

Allowed values: *STMF, *MODULE, *ALL

INFOSTMF Program interface stream file

Path name of the stream file that receives the generated program interface information. Valid only when PGMINFO is not *NO.

Type
*CHAR
Required
No
Length
50
Case
Uppercase

PPGENOPT Preprocessor options

Preprocessor generation options used when the source is compiled.

Type
*CHAR
Required
No
Default
*NONE
Length
13
List limit
3
Case
Uppercase

Allowed values: *NONE, *DFT, *RMVCOMMENT, *NORMVCOMMENT, *EXPINCLUDE, *NOEXPINCLUDE, *SEQSRC, *NOSEQSRC

*NONE
Run the full compiler on the source; no preprocessor output file.
*DFT
Run the preprocessor using *RMVCOMMENT, *EXPINCLUDE and *NOSEQSRC.
*RMVCOMMENT
Remove comments, blank lines and most directives.
*NORMVCOMMENT
Keep comments, blank lines and listing directives.
*EXPINCLUDE
Expand /INCLUDE directives in the output.
*NOEXPINCLUDE
Leave /INCLUDE directives unchanged in the output; /COPY is always expanded.
*SEQSRC
Sequential sequence numbers in the output member, starting at 000001.
*NOSEQSRC
Keep the sequence numbers of the original source.

PPSRCFILE Output source file

Source file name and library for the preprocessor output.

Type
*QUAL
Required
No
Case
Uppercase
*CURLIB
Current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Output source file Output source file

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *CURLIB

PPSRCMBR Output source member

Name of the source file member for the preprocessor output.

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

Suggested / special values: *MODULE

*MODULE
Use the MODULE name.

PPSRCSTMF Output stream file

Path name of the stream file for the preprocessor output. The file gets the extension .i.

Type
*CHAR
Required
No
Length
50
Case
Uppercase

Suggested / special values: *SRCSTMF

*SRCSTMF
Use the SRCSTMF path name.

TGTCCSID Target CCSID

CCSID the compiler uses to read the source files; 1 through 65534 may be given.

Type
*UINT2
Required
No
Default
*SRC
Range
1 to 65534
Case
Uppercase

Suggested / special values: *SRC, *JOB

*SRC
Read in the CCSID of the primary source file (default).
*JOB
Read in the job CCSID; if that is 65535, the job's default CCSID.

REQPREXP Require prototype for export

Whether prototypes are required for the main procedure and exported procedures.

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

Allowed values: *NO, *WARN, *REQUIRE

*NO
Not required (default).
*WARN
Severity-10 warning if a prototype is missing.
*REQUIRE
Severity-30 error if a prototype is missing.

Examples

CRTRPGMOD MODULE(MYLIB/XMPLE1) SRCFILE(MYLIB/QRPGLESRC) SRCMBR(XMPLE1) OUTPUT(*PRINT) TEXT('My RPG IV module')

Compiles source member XMPLE1 of source file QRPGLESRC in library MYLIB into a module named XMPLE1 and creates a compiler listing.

IBM command documentation

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