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.
*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
Suggested / special values:
*CTLSPEC
Library
Library
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.
*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
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SRCMBR
Source member
Name of the source file member that holds the ILE RPG specifications to compile.
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.
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.
TEXT
Text 'description'
Text describing the module, up to 50 characters.
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.
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.
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.
Suggested / special values:
*NONE
*NONE- No encryption key.
OUTPUT
Output
Whether a compiler listing is generated.
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.
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.
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.
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.
*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
Library
Library
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.
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.
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.
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.
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.
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.
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.
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.
Suggested / special values:
*NONE
*NONE- No condition names are defined.
ENBPFRCOL
Enable performance collection
Whether performance statistics are gathered.
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.
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.
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.
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
Library
Library
Suggested / special values:
*LIBL, *CURLIB
LICOPT
Licensed Internal Code options
One or more Licensed Internal Code compile-time options, intended for advanced programmers.
INCDIR
Include directory
Directories added to the search path for copy files; up to 32. The source directory is always searched.
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.
*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
Allowed values:
*NO, *PCML
Location
Location
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.
PPGENOPT
Preprocessor options
Preprocessor generation options used when the source is compiled.
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.
*CURLIB- Current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Output source file
Output source file
Library
Library
Suggested / special values:
*CURLIB
PPSRCMBR
Output source member
Name of the source file member for the preprocessor output.
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.
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.
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.
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.
Generated from os/cl/catalog/CRTRPGMOD.json and os/cl/help/CRTRPGMOD.json.