Create C++ Module (CRTCPPMOD)

The Create C++ Module (CRTCPPMOD) command starts the ILE C++ compiler. The compiler attempts to create a module object based on the ILE C++ statements in the source code.

Parameters

Keyword Description Choices Notes
MODULE Module Qualified object name Required, Positional 1
Qualifier 1: Module Name
Qualifier 2: Library Name, *CURLIB
SRCFILE Source file Qualified object name Optional, Positional 2
Qualifier 1: Source file Name, QCPPSRC
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCMBR Source member Name, *MODULE Optional, Positional 3
SRCSTMF Source stream file Path name Optional
TEXT Text 'description' Character value, *SRCMBRTXT, *BLANK Optional
OUTPUT Output options Single values: *NONE, '*none'
Other values: Element list
Optional
Element 1: Output file name Path name, *PRINT, '*print'
Element 2: Title Character value, *BLANK
Element 3: Subtitle Character value, *BLANK
OPTION Compiler options Values (up to 35 repetitions): *NOBITSIGN, *BITSIGN, *NOEVENTF, *EVENTF, *NOEXPMAC, *EXPMAC, *NOFULL, *FULL, *GEN, *NOGEN, *NOINCDIRFIRST, *INCDIRFIRST, *LOGMSG, *NOLOGMSG, *LONGLONG, *NOLONGLONG, *NORTTI, *RTTIALL, *RTTITYPE, *RTTICAST, *NOSHOWINC, *SHOWINC, *SHOWSRC, *NOSHOWSRC, *NOSHOWSYS, *SHOWSYS, *NOSHOWUSR, *SHOWUSR, *STDINC, *NOSTDINC, *NOSTDLOGMSG, *STDLOGMSG, *NOSYSINCPATH, *SYSINCPATH, *NOXREF, *XREF, *NOXREFREF, *XREFREF Optional
CHECKOUT Checkout options Values (up to 45 repetitions): *NONE, *USAGE, *ALL, *NOCLASS, *CLASS, *NOCOND, *COND, *NOEFFECT, *EFFECT, *NOGENERAL, *GENERAL, *NOGOTO, *GOTO, *NOLANG, *LANG, *NOPARM, *PARM, *NOPORT, *PORT, *NOPPTRACE, *PPTRACE, *NOREACH, *REACH, *NOTEMP, *TEMP, *NOTRUNC, *TRUNC, *NOUNUSED, *UNUSED Optional
OPTIMIZE Optimization 10, 20, 30, 40 Optional
INLINE Inline options Element list Optional
Element 1: Inliner *OFF, *ON
Element 2: Mode *AUTO, *NOAUTO
Element 3: Threshold 1-65535, 250, *NOLIMIT
Element 4: Limit 1-65535, 2000, *NOLIMIT
Element 5: Report *NO, *YES
MODCRTOPT Module creation options *NOKEEPILDTA, *KEEPILDTA Optional
DBGVIEW Debugging view *NONE, *ALL, *STMT, *SOURCE, *LIST Optional
DBGENCKEY Debug encryption key Character value, *NONE Optional
DEFINE Define names Single values: *NONE
Other values (up to 32 repetitions): Character value
Optional
LANGLVL Language level *EXTENDED, *ANSI, *LEGACY, *EXTENDED0X Optional
ALIAS Alias Values (up to 3 repetitions): *ANSI, *NOANSI, *ADDRTAKEN, *NOADDRTAKEN, *ALLPTRS, *NOALLPTRS, *TYPEPTR, *NOTYPEPTR Optional
SYSIFCOPT System interface options *IFS64IO, *IFSIO, *NOIFSIO Optional
LOCALETYPE Locale object type *LOCALE, *LOCALEUCS2, *LOCALEUTF Optional
FLAG Message flagging level 0, 10, 20, 30 Optional
MSGLMT Compiler messages Element list Optional
Element 1: Message limit 0-32767, *NOMAX
Element 2: Message limit severity 0, 10, 20, 30
REPLACE Replace module object *YES, *NO Optional
AUT Authority Name, *LIBCRTAUT, *ALL, *CHANGE, *USE, *EXCLUDE Optional
TGTRLS Target release Simple name, *CURRENT, *PRV Optional
ENBPFRCOL Enable performance collection Element list Optional
Element 1: Collection level *PEP, *ENTRYEXIT, *FULL
Element 2: Procedures *NONLEAF, *ALLPRC
PFROPT Performance options Values (up to 2 repetitions): *SETFPCA, *NOSETFPCA, *NOSTRDONLY, *STRDONLY Optional
PRFDTA Profiling data *NOCOL, *COL Optional
TERASPACE Teraspace options Single values: *NO
Other values: Element list
Optional
Element 1: Teraspace enabled *YES
Element 2: Use teraspace interfaces *NOTSIFC, *TSIFC
STGMDL Storage model *SNGLVL, *TERASPACE, *INHERIT Optional
DTAMDL Data model *P128, *LLP64 Optional
RTBND Run time Binding *DEFAULT, *LLP64 Optional
PACKSTRUCT Pack structure *NATURAL, 1, 2, 4, 8, 16 Optional
ENUM Enum size *SMALL, 1, 2, 4, *INT Optional
MAKEDEP Dependency information Path name, *NONE Optional
PPGENOPT Preprocessor options Single values: *NONE, *DFT
Other values (up to 2 repetitions): *RMVCOMMENT, *NORMVCOMMENT, *GENLINE, *NOGENLINE
Optional
PPSRCFILE Output source file Qualified object name Optional
Qualifier 1: Output source file Name
Qualifier 2: Library Name, *CURLIB
PPSRCMBR Output source member Name, *MODULE Optional
PPSRCSTMF Output stream file Path name, *SRCSTMF Optional
INCDIR Include directory Single values: *NONE
Other values (up to 32 repetitions): Path name
Optional
CSOPT Compiler services option Character value, *NONE Optional
LICOPT Licensed internal code options Character value, *NONE Optional
DFTCHAR Default char type *UNSIGNED, *SIGNED Optional
TGTCCSID Target CCSID 1-65535, *SOURCE, *JOB, *HEX Optional
TEMPLATE Template options Element list Optional
Element 1: Temporary include directory Path name, *NONE, *TEMPINC
Element 2: Maximum generated headers 1-99999, 1
Element 3: Template validity checking *NO, *WARN, *ERROR
TMPLREG Template registry Path name, *DFT, *NONE Optional
WEAKTMPL Weak Template Definitions *YES, *NO Optional
DECFLTRND Decimal float round mode *HALFEVEN, *DOWN, *UP, *HALFUP, *HALFDOWN, *FLOOR, *CEILING Optional

Module (MODULE)

Specifies the module object to create.

This is a required parameter.

Qualifier 1: Module

name
Specify the name of the module object.

Qualifier 2: Library

*CURLIB
The module object is stored in the current library. If a job does not have a current library, the module object is created in the QGPL library.
name
Specify the name of the library where the module object will be stored.

Source file (SRCFILE)

Specifies the source file containing the ILE C++ source code that you want to compile.

Qualifier 1: Source file

QCPPSRC
The source file named QCPPSRC contains the member with the ILE C++ source code that you want to compile.
name
Specify the name of the source file that contains the member with the ILE C++ source code.

Qualifier 2: Library

*LIBL
The library list is searched to find the library where the source file is located.
*CURLIB
The current library is searched for the source file. If a job does not have a current library, QGPL is searched for the source file.
name
Specify the name of the library that contains the source file.

Source member (SRCMBR)

Specifies the source file member containing the source code to be compiled.

*MODULE
The name specified for the Module (MODULE) parameter is used as the source member name.
name
Specify the name of the member that contains the source code.

Source stream file (SRCSTMF)

Specifies the stream file containing the source code that you want to compile.

The path name can be either absolutely or relatively qualified. An absolute path name starts with '/'; a relative path name starts with a character other than '/'. If absolutely-qualified, the path name is complete. If relatively-qualified, the path name is completed by pre-pending the job's current working directory to the path name.

The SRCMBR and SRCFILE parameters cannot be specified with the SRCSTMF parameter.

path-name
Specify the path name of the stream file that contains the C++ source code.

Text 'description' (TEXT)

Specifies the text that briefly describes the module object.

*SRCMBRTXT
The text description associated with the source file member is used for the module object. If the source file is an inline file, a stream file, or a device file, the text will be blank.
*BLANK
Specifies that no text appears.
character-value
Specify no more than 50 characters of text, enclosed in apostrophes.

Output options (OUTPUT)

Specifies whether a compiler listing is produced.

Single values

*NONE
Does not generate the compiler listing. When a listing is not required, this parameter value should be used to improve compile-time performance. When *NONE is specified, any listing-related parameter values specified for the OPTION parameter are ignored.

Element 1: Output file name

*PRINT
Generates a spooled file containing the listing.
path-name
Specify the path name of a stream file to hold the listing.

Element 2: Title

*BLANK
Specifies that no text appears.
character-value
Specify a title string for the listing file (maximum 80 characters).

Element 3: Subtitle

*BLANK
Specifies that no text appears.
character-value
Specify a subtitle string for the listing file (maximum 80 characters).

Compiler options (OPTION)

Specifies the options to use when the ILE C++ source code is compiled. You can specify them in any order, separated by one or more blanks. When an option is specified more than once, or when two options conflict, the last one specified is used.

You can specify 35 values for this parameter.

There is no single default value for this parameter. In the following sets of parameter value descriptions, the underlined values identify the default values that will be used by the compiler.

*NOBITSIGN
Specify bitfields as unsigned.
*BITSIGN
Specify bitfields as signed.
*NOEVENTF
Do not create an event file for use by CoOperative Development Environment/400 (CODE/400).
*EVENTF
Create an event file for use by CoOperative Development Environment/400 (CODE/400). The event file is created as a member in file EVFEVENT in the library where the module or program object being created will be stored. If the file EVFEVENT does not exist, it is automatically created. The event file member name is the same as the name of the object being created. An Event File is normally created when you create a module or program object from within CODE/400. CODE/400 uses this file to provide error feedback integrated with the CODE/400 editor.
*NOEXPMAC
Macros are not expanded in the listing unless a syntax error is encountered within the macro.
*EXPMAC
Expand all macros in the listing.
*NOFULL
Do not turn on all listing options.
*FULL
Turn on all listing options.
*GEN
All phases of the compilation process are carried out.
*NOGEN
Compilation stops after syntax checking. No module object is created.
*NOINCDIRFIRST
Include directories specified as INCDIR parameters are not included before the standard header file include path.
*INCDIRFIRST
Include directories specified as INCDIR parameters are included before the standard header file include path.
*LOGMSG
Puts the compilation messages in the job log.

When you specify this option and the FLAG parameter, messages with the severity specified on the FLAG parameter (and higher) are placed in the job log.

When you specify this option and a maximum number of messages on the Message limit (MSGLMT) parameter, compilation stops when the number of messages, at the specified severity, have been placed in the job log.

*NOLOGMSG
Does not put the compilation messages in the job log.
*LONGLONG
Allows the use of the long long data type.
*NOLONGLONG
Do not allow the use of the long long data type.
*NORTTI
Do not generate run-time type identification (RTTI) information.
*RTTIALL
Generate the information needed for the RTTI typeid and the dynamic_cast operator.
*RTTITYPE
Generate the information needed for the RTTI typeid operator only.
*RTTICAST
Generate the information needed for the dynamic_cast operator only.
*NOSHOWINC
Does not expand the user include files or the system include files in the source section of the listing or in the debug views.
*SHOWINC
Expands both the user include files and the system include files in the source section of the listing or in the debug views. An OUTPUT option, or DBGVIEW parameter value of *ALL, *SOURCE or *LIST must be specified.
*SHOWSRC
Show the source code in the listing. This option can be modified by the *SHOWINC, *SHOWSYS or *SHOWUSR options.
*NOSHOWSRC
Does not show the source code in the listing. This option may be modified by the *EXPMAC, *SHOWINC, *SHOWSYS or *SHOWUSR options.
*NOSHOWSYS
Do not expand the system include files on the #include directive in the source section of the listing or in the debug views. System include files are enclosed in angle brackets (< >) following the #include directive.
*SHOWSYS
Expands the system include files on the #include directive in the source section of the listing or in the debug views. An output option, or DBGVIEW parameter of *ALL, *SOURCE or *LIST must be specified. System include files are enclosed in angle brackets (< >) following the #include directive.
*NOSHOWUSR
Do not expand user include files in the listing or debug views. User include files are enclosed in double quotation marks (" ") following the #include directive.
*SHOWUSR
Expands the user include files on the #include directive in the source section of the listing or in the debug views. An OUTPUT option, or DBGVIEW parameter value of *ALL, *SOURCE or *LIST must be specified. User include files are enclosed in double quotation marks (" ") following the #include directive.
*STDINC
The system-supplied header files are included in the search path for the compile.
*NOSTDINC
The system-supplied header files are not included in the search path for the compile.
*NOSTDLOGMSG
Compilation messages are not sent to the stdout stream.
*STDLOGMSG
Compilation messages are sent to the stdout stream.
*NOSYSINCPATH
The search path for user includes is not affected.
*SYSINCPATH
Changes the search path of user includes to the system include search path. In function this option is equivalent to changing the double-quotes in the user #include directive (#include "file_name") to angle brackets (#include <file_name>).
*NOXREF
Does not generate the cross-reference table in the listing.
*XREF
Generates the cross-reference table containing a list of the identifiers in the source code together with the numbers of the lines in which they appear. An OUTPUT option must be specified.
*NOXREFREF
Do not produce a cross-reference table of referenced identifiers in the listing.
*XREFREF
Produce a cross-reference table of referenced variables, structures, and function names in the listing file. The table shows the line numbers where the identifiers are declared. An OUTPUT option must be specified.

Checkout options (CHECKOUT)

Specifies options you may select to generate informational messages that indicate possible programming errors. When you specify an option more than once, or when two options conflict, the last one specified is used.

You can specify 45 values for this parameter.

*NONE
Disables all of the options for CHECKOUT.
*USAGE
This is equivalent to specifying *COND.
*ALL
Enables all of the options for CHECKOUT.

In the following sets of parameter value descriptions, the underlined values identify the default values that will be used by the compiler.

*NOCLASS
Do not display information about class use.
*CLASS
Display information about class use.
*NOCOND
Do not warn about possible redundancies or problems in conditional expressions.
*COND
Warn about possible redundancies or problems in conditional expressions.
*NOEFFECT
Do not warn about statements with no effect.
*EFFECT
Warn about statements with no effect.
*NOGENERAL
Do not generate general checkout messages.
*GENERAL
Generate general checkout messages.
*NOGOTO
Does not list the occurrence and usage of goto statements.
*GOTO
Lists the occurrence and usage of goto statements.
*NOLANG
Do not display information about the effects of the language level.
*LANG
Display information about the effects of the language level.
*NOPARM
Do not warn about unused parameters.
*PARM
Warn about unused parameters.
*NOPORT
Do not warn about non-portable language constructs.
*PORT
Warn about non-portable language constructs.
*NOPPTRACE
Does not list the tracing of include files by the preprocessor.
*PPTRACE
Lists the tracing of include files by the preprocessor.
*NOREACH
Do not warn about unreachable statements.
*REACH
Warn about unreachable statements.
*NOTEMP
Do not generate messages if the compiler creates temporary variables.
*TEMP
Generate messages if the compiler creates temporary variables.
*NOTRUNC
Do not warn about the possible truncation or loss of data.
*TRUNC
Warn about the possible truncation or loss of data.
*NOUNUSED
Do not check for unused auto or static variables.
*UNUSED
Check for unused auto or static variables.

Optimization (OPTIMIZE)

Specifies the levels of optimization of the generated object.

10
Generated code is not optimized. This level has the shortest compile time. This level allows variables to be displayed and modified while debugging.
20
Some optimization is performed on the code. This level allows user variables to be displayed but not modified while debugging.
30
Full optimization is performed on the generated code. During a debug session, user variables may not be modified but may be displayed. The presented values may not be the current value of the variable.
40
All optimizations done at level 30 are performed on the generated code. In addition, code is eliminated from procedure prologue and epilogue routines that enable instruction trace and call trace system functions. Eliminating this code enables the creation of leaf procedures. A leaf procedure is a procedure that contains no calls to other procedures. Procedure call performance to a leaf procedure is significantly faster than to a normal procedure.

Inline options (INLINE)

Specifies whether the compiler should consider replacing a function call with the called function's instructions. Inlining a function eliminates the overhead of a call and can result in better optimization. Small functions that are called many times are good candidates for inlining.

Element 1: Inliner

Specifies whether or not inlining will be used.

*OFF
Specifies that inlining will not be performed on the compilation unit.
*ON
Specifies that inlining will be performed on the compilation unit. If a debug view is specified, the inliner is turned off.

Element 2: Mode

Specifies whether or not the inliner should attempt to automatically inline functions depending on their Threshold and Limit values.

*AUTO
Specifies that the inliner should determine if a function can be inlined based on the Threshold and Limit values specified. The #pragma noinline directive overrides *AUTO.
*NOAUTO
Specifies that only the functions that have been specified with the #pragma inline directive should be considered candidates for inlining.

Element 3: Threshold

Specifies the maximum size of a function that can be a candidate for automatic inlining. The size is measured in Abstract Code Units (ACUs). ACUs are proportional in size to the executable code in the function. Source code is translated into ACUs by the compiler.

250
Specifies a threshold of 250.
1-65535
Specifies a threshold for ACUs.
*NOLIMIT
Defines the threshold as the maximum size of the program object.

Element 4: Limit

Specifies the maximum relative size a function can grow before auto-inlining stops.

2000
Specifies a limit of 2000 ACUs.
*NOLIMIT
Limit is defined as the maximum size of the program object. System limits may be encountered.
1-65535
Specify the ACU limit.

Element 5: Report

Specifies whether or not to produce an inliner report with the compiler listing.

*NO
The inliner report is not produced.
*YES
The inliner report is produced as part of the compiler listing. An OUTPUT option must be specified to produce the inliner report.

Module creation options (MODCRTOPT)

Specifies the options to use when the module object is created.

*NOKEEPILDTA
Intermediate language data is not stored with the module object.
*KEEPILDTA
Intermediate language data is stored with the module object.

Debugging view (DBGVIEW)

Specifies which level of debugging is available for the module in the created program or service program object. It also specifies which source views are available for source level debugging. Requesting a debug view will turn inlining off.

*NONE
Debug capability is not inserted into the module object.
*ALL
Enables all of the debug options (*STMT, *SOURCE and *LIST)
*STMT
Allows the module object to be debugged using program statement numbers and symbolic identifiers.

Note: To debug a module object using the *STMT option you need a listing.

*SOURCE
Generates the source view for debugging the module object. OPTION parameter values *NOSHOWINC, *SHOWINC, *SHOWSYS, and *SHOWUSR determine the content of the source view created.

Note: In order to use this view for debugging, the root source file should not be modified, renamed or moved after the module object is created.

*LIST
Generates the listing view for debugging the module object. OPTION parameter values *SHOWINC, *SHOWUSR, *SHOWSYS, and *NOSHOWINC determine the content of the listing view created.

Debug encryption key (DBGENCKEY)

Specifies the encryption key to be used to encrypt program source that is embedded in debug views.

*NONE
No encryption key is specified.
character-value
Specify the key to be used to encrypt program source that is embedded in debug views stored in the module object. The length of the key can be between 1 and 16 bytes. A key of length 1 to 15 bytes will be padded to 16 bytes with blanks for the encryption. Specifying a key of length zero is the same as specifying *NONE.

If the key contains any characters which are not invariant over all code pages, it will be up to the user to ensure that the target system uses the same code page as the source system, otherwise the key may not match and the decryption may fail. If the encryption key must be entered on systems with differing code pages, it is recommended that the key be made of characters which are invariant for all EBCDIC code pages.

Define names (DEFINE)

Specifies preprocessor macros that take effect before the file is processed by the compiler. Using the format DEFINE(macro) is equivalent to DEFINE('macro=1').

Single values

*NONE
No macro is defined.

Other values (up to 32 repetitions)

'name' or 'name=value'
A maximum of 32 macros may be defined. Each macro name is enclosed in apostrophes. The maximum length of a macro name is 80 characters. The apostrophes are not part of the 80 character string. The apostrophes are required for case-sensitive macro names.

Note: Macros defined in the command override any macro definition of the same name in the source but a warning message is generated by the compiler. Function-like macros such as #define max(a,b) ((a)>(b)?(a):(b)) cannot be defined on the command line.

Language level (LANGLVL)

Specifies the capabilities of the compiler and which prototypes are declared when the source is created.

*EXTENDED
Defines the preprocessor variable __EXTENDED__ and undefines other language-level variables. This parameter should be used when all the capabilities of ILE C++ are required.
*ANSI
Defines the preprocessor variables __ANSI__, __STDC__ and __cplusplus98_interface__, and undefines other language-level variables. Only ANSI-standard C++ is made available.
*LEGACY
This option allows some of the source constructs acceptable to earlier compilers.
*EXTENDED0X
This option compiles code using all the capabilities of ILE C++ and currently supported C++11 features that are implemented in this version of ILE C++ compiler.

Alias (ALIAS)

Specifies the aliasing assertion to be applied to the module object being created.

You can specify 3 values for this parameter.

*ANSI
The module object will only allow pointers to point to an object of the same type.
*NOANSI
The module object will not use the *ANSI aliasing rules.
*ADDRTAKEN
The module object will have its class of variables disjoint from pointers unless their address is taken.
*NOADDRTAKEN
The module object will not use the *ADDRTAKEN aliasing rules.
*ALLPTRS
The module object will not allow any two pointers to be aliased.
*NOALLPTRS
The module object will not use the *ALLPTRS aliasing rules.
*TYPEPTR
The module object will not allow any two pointers of different types to be aliased.
*NOTYPEPTR
The module object will not use the *TYPEPTR aliasing rules.

System interface options (SYSIFCOPT)

Specifies which system interface options will be used for the module object being created.

*IFS64IO
The module object will use the Integrated File System for 64-bit C stream I/O operations.
*IFSIO
The module object will use the Integrated File System for C stream I/O operations.
*NOIFSIO
The module object will use the Data Management file system for C stream I/O operations.

Locale object type (LOCALETYPE)

Specifies the type of locale support to be used by the module object being created.

*LOCALE
Module objects created with this option use the locale support provided by *LOCALE objects.
*LOCALEUCS2
Module objects created with this option use the locale support provided by *LOCALE objects. Wide-character types will contain two-byte universal character set values.
*LOCALEUTF
Module objects created with this option use the locale support provided by *LOCALE objects. Wide-character types will contain four-byte utf-32 values. Narrow character types will contain utf-8 values.

Message flagging level (FLAG)

Specifies the level of messages that are to be displayed in the listing.

0
All messages starting at the informational level are displayed.
10
All messages starting at the warning level are displayed.
20
All messages starting at the error level are displayed.
30
All messages starting at the severe error level are displayed.

Message limit (MSGLMT)

Specifies the maximum number of messages at the given message severity (or higher) that can occur before the compilation is stopped.

Element 1: Message limit

Specifies the maximum number of messages that can occur at, or above, the message severity level specified.

*NOMAX
Compilation continues regardless of the number of messages that have occurred at the message severity level specified.
0-32767
Specify the number of messages that can occur.

Element 2: Message limit severity

Specifies the message severity that can stop the compilation if the number of messages (specified for element 1) at the specified severity or above occur.

30
The specified number of messages at severity 30 can occur before compilation stops.
0
The specified number of messages at severity 0 or above can occur before compilation stops.
10
The specified number of messages at severity 10 or above can occur before compilation stops.
20
The specified number of messages at severity 20 or above can occur before compilation stops.

Replace module object (REPLACE)

Specifies whether the existing version of the object will be replaced by the current version.

*YES
The existing object is replaced by the new version. The old version is moved to the QRPLOBJ library and renamed based on the system date and time. The text description of the replaced object is changed to the name of the original object. The old object is deleted at the next IPL if it has not been explicitly deleted.
*NO
The existing object is not replaced. When an object with the same name is found in the specified library, a message is displayed and compilation stops.

Authority (AUT)

Specifies the authority granted to users who do not have specific authority to the object, who are not on the authorization list, or whose group has no specific authority to the object.

*LIBCRTAUT
Public authority for the object is taken from the CRTAUT keyword of the target library (the library that contains the created object). This value is determined when the object is created. When the CRTAUT value for the library changes after the object is created, the new value does not affect any existing objects in the library.
*ALL
Provides authority for all operations on the object except those limited to the owner or controlled by authorization list management authority. Any user can control the object's existence, specify the security for it, change it, and perform basic functions on it, including transfer its ownership.
*CHANGE
Provides all data authority and the authority to perform all operations on the object except those limited to the owner or controlled by object authority and object management authority. The object can be changed and basic functions can be performed on it.
*USE
Provides object operational authority; read authority; and authority for basic read-only operations on the object, such as binding of a module object. Users without specific authority are prevented from changing the object.
*EXCLUDE
Users without special authority cannot access the object.
name
Specify the name of an authorization list of users and authorities to which the object is added. The object is secured by this authorization list, and the public authority for the object is set to *AUTL. The authorization list must exist on the system when the command is issued.

Target release (TGTRLS)

Specifies the release of the operating system on which the user intends to use the object being created.

In the examples given for the *CURRENT and *PRV values, and when specifying the release-level 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, V4R5M0 is version 4, release 5, modification level 0.

*CURRENT
The object will be used on the release of the operating system currently running on the user's system. For example, if V6R1M0 is running on the system, *CURRENT means the user intends to use the object on a system with V6R1M0 installed. The user can also use the object on a system with any subsequent release of the operating system installed.
*PRV
The object will be used on the previous release with modification level 0 of the operating system. For example, if V6R1M0 is running on the user's system, *PRV means the user intends to use the object on a system with V5R4M0 installed. The user can also use the object on a system with any subsequent release of the operating system installed.
release-level
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.

Valid values depend on the current version, release, and modification level. They change with each new release. If you specify a release level which is earlier than the earliest release level supported by this command, an error message is sent.

Enable performance collection (ENBPFRCOL)

Specifies whether performance measurement code should be generated in the object. The data collected can be used by the system performance tool to profile an application's performance. Generating performance measurement code in a created object will result in slightly larger objects and may affect performance.

Note: Starting in V6R1M0, this parameter will no longer have an effect on the created objects. It exists solely for compatibility with releases earlier than V6R1M0.

*PEP
Performance statistics are gathered on the entry and exit of the program entry procedure only. Choose this value when you want to gather overall performance information for an application.
*ENTRYEXIT *NONLEAF
Performance statistics are gathered on the entry and exit of all procedures of the program object that are not leaf procedures. This includes the program PEP routine.

This choice would be useful if you only wanted to capture information on those routines that invoke other routines in your application.

*ENTRYEXIT *ALLPRC
Performance statistics are gathered on the entry and exit of all the procedures of the program object (including those that are leaf procedures). This includes the program PEP routine.

This choice would be useful if you wanted to capture information on all routines. Use this option when you know that all the program objects called by your application were created with either the *PEP, *ENTRYEXIT or *FULL option. Otherwise, if your application calls other program objects that are not enabled for performance measurement, the performance tool will charge their use of resources against your application. This would make it difficult for you to determine where resources are actually being used.

*FULL *NONLEAF
Performance statistics are gathered on entry and exit of all procedures that are not leaf procedures. Also, statistics are gathered before and after each call to an external procedure.
*FULL *ALLPRC
Performance statistics are gathered on the entry and exit of all procedures including leaf procedures. Also statistics are gathered before and after each call to an external procedure.

Use this option when you think that your application will call other program objects that were not created with either *PEP, *ENTRYEXIT or *FULL. This option allows the performance tools to distinguish between resources that are used by your application and those used by program objects it calls (even if those program objects are not enabled for performance measurement). This option is the most expensive but allows for selectively analyzing various program objects in an application.

Performance options (PFROPT)

Specifies various options available to boost performance. You can specify them in any order, separated by one or more blanks. When an option is specified more than once, or when two options conflict, the last one specified is used.

You can specify 2 values for this parameter.

*SETFPCA
Causes the compiler to set the floating point computational attributes to achieve ANSI semantics for floating point computations.
*NOSETFPCA
No computational attributes will be set. This option should only be used when the object being created does not have any floating point computations in it.
*NOSTRDONLY
Specifies that the compiler must place strings into writeable memory.
*STRDONLY
Specifies that the compiler may place strings into read-only memory.

Profiling data (PRFDTA)

Specifies the program profiling data attribute for the module object. Program profiling is an advanced optimization technique used to reorder procedures and code within the procedures based on statistical data (profiling data).

*NOCOL
The module object is not enabled to collect profiling data.
*COL
The module object is enabled to collect profiling data. *COL can be specified only when the optimization level is 30 or greater.

Teraspace options (TERASPACE)

Specifies whether the module object is enabled to work with teraspace storage. This includes teraspace storage allocated by the module object and parameters passed from other teraspace-enabled program and service program objects.

Single values

*NO
The module object is not enabled to handle addressing of storage allocated from teraspace.

Note: Starting in V6R1M0, all modules are enabled to handle addressing of storage allocated from teraspace. However, if *NO is specified, the compiler facilities listed below will not be available.

Element 1: Teraspace enabled

*YES
The module object is enabled to handle addressing of storage allocated from teraspace, including parameters passed from other teraspace-enabled program and service program objects. In addition, the following compiler facilities are enabled:
  • Pointers may be qualified with __ptr64 to allow creation of 8-byte pointers used to access teraspace storage.
  • The teraspace storage model can be specified with the STGMDL(*TERASPACE) compiler option.
  • The LLP64 data model can be specified with the DTAMDL(*LLP64) compiler option or the #pragma datamodel(llp64) directive.
  • Pointer difference arithmetic returns a signed long long result instead of a ptrdiff_t result.

Element 2: Use teraspace interfaces

*NOTSIFC
The module object will default to use the non-teraspace versions of the storage functions.
*TSIFC
The module object will default to use the teraspace versions of the storage functions. The compiler will define macro variable __TERASPACE__.

Storage model (STGMDL)

Specifies the type of storage to be used by the object created.

*SNGLVL
The object created will use single-level storage.
*TERASPACE
The object created will use teraspace storage.
*INHERIT
The object created can use either single level or teraspace storage. The type of storage used will depend on the type of storage required by the caller.

Data model (DTAMDL)

Specifies the sizes (in bytes) of variables declared as int, long, pointer.

*P128
Causes the sizes of int, long, pointer to be 4, 4, 16 respectively.
*LLP64
Causes the sizes of int, long, pointer to be 4, 4, 8 respectively. The compiler will define the macro __LLP64_IFC__.

Run time Binding (RTBND)

Specifies the run time binding directory for the object created.

*DEFAULT
The object created will use the default binding directory.
*LLP64
The object created will use the 64-bit run time binding directory. This value is only available in conjunction with teraspace storage model, 64-bit data model and teraspace storage functions interface options. The compiler will define the macro __LLP64_RTBND__.

Pack structure (PACKSTRUCT)

Specifies the alignment boundary to use for members of a structure.

*NATURAL
Structure members are aligned on their natural boundaries. For example, a short integer will be two-byte aligned. 16-byte pointers will always align on 16-byte boundaries.
1
Pack structure members on a 1-byte alignment.
2
Pack structure members on a 2-byte alignment.
4
Pack structure members on a 4-byte alignment.
8
Pack structure members on a 8-byte alignment.
16
Pack structure members on a 16-byte alignment.

Enum size (ENUM)

Specifies the number of bytes the compiler uses to represent an enumeration.

*SMALL
Make all enum variables the smallest size that can represent the range of values.
1
Make all enum variables 1 byte.
2
Make all enum variables 2 bytes.
4
Make all enum variables 4 bytes.
*INT
Use the ANSI-standard enum size, which is 4 bytes.

Dependency information (MAKEDEP)

Specifies whether or not to generate dependency information into a file. This information can be used by a make tool.

*NONE
Do not generate dependency information.
path-name
Specify a path name for the stream file in which to store the dependency information.

Preprocessor options (PPGENOPT)

Specifies the preprocessor generation options to use when the source code is compiled.

Single values

*NONE
Run the entire compiler against the source file. Do not copy the preprocessor output to a file.
*DFT
Run the preprocessor against the input source. *RMVCOMMENT and *GENLINE will be used as the options for generating the preprocessor output. Use PPSRCFILE and PPSRCMBR to specify an output source file and member, or PPSRCSTMF to specify a stream file to contain the preprocessor output.

Other values (up to 2 repetitions)

*RMVCOMMENT
Remove comments during preprocessing.
*NORMVCOMMENT
Preserve comments during preprocessing.
*GENLINE
Produce #line directives in the preprocessor output.
*NOGENLINE
Suppress #line directives from the preprocessor output.

Output source file (PPSRCFILE)

Specifies the physical file for the preprocessor output.

Qualifier 1: Output source file

name
Specify the name of the physical file for the preprocessor output.

Qualifier 2: Library

*CURLIB
The preprocessor output is created in the current library. If a job does not have a current library, the preprocessor output file is created in the QGPL library.
name
Specify the name of the library for the preprocessor output.

Output source member (PPSRCMBR)

Specifies the physical file member for the preprocessor output.

*MODULE
The name specified for the Module (MODULE) parameter is used as the preprocessor output member name.
name
Specify the name of the member for the preprocessor output.

Output stream file (PPSRCSTMF)

Specifies the path name of the stream file for the preprocessor output.

*SRCSTMF
The path name specified for the Source stream file (SRCSTMF) parameter is used as the preprocessor output path name. The file will have the extension '.i'.
path-name
Specify the path name for the preprocessor output stream file.

Include directory (INCDIR)

Specifies one or more directories to add to the search path used by the compiler to find include files.

The search path can be further modified by using the following parameters on the OPTION keyword:

*NONE
Unless modified, the default system include directory and the source directory will be searched for user include files.
path-name
Specify the path name of a directory in which to search for include files. Up to 32 directories may be specified. In addition to the specified directories, the source directory is searched for user include files.

Compiler services option (CSOPT)

Specifies one or more compiler service options. This parameter allows IBM to provide switchable compiler capability between releases.

*NONE
No compiler service option is selected.
character-value
Specify a character string that contains the compiler service options to use when creating the module object. Valid strings will be described in PTF cover letters or in release notes.

Licensed internal code options (LICOPT)

Specifies one or more Licensed Internal Code compile-time options. This parameter allows individual compile-time options to be selected, and is intended for the advanced programmer who understands the potential benefits and drawbacks of each selected type of compiler option.

*NONE
No compile-time options are selected.
character-value
The selected Licensed Internal Code compile-time options are used when creating the module object. Certain options may reduce your ability to debug the created module object.

Default char type (DFTCHAR)

Specifies the default sign for the char data type.

*UNSIGNED
Make default char type unsigned.
*SIGNED
Make default char type signed.

Target CCSID (TGTCCSID)

Specifies the target coded character set identifier used to describe data stored into the resulting module object.

*SOURCE
The root source file's CCSID is used.
*JOB
The current job's CCSID is used.
*HEX
The CCSID 65535 is used, which indicates that character data is treated as binary data and is not converted.
1-65535
Specify the CCSID to be used.

Template options (TEMPLATE)

Specifies template options to the compiler.

Element 1: Temporary include directory

*NONE
Templates are not generated.
*TEMPINC
Templates are generated into a directory named tempinc which is created in the directory where the root source file was found. If the source file is not a stream file, a file named TEMPINC will be created in the library where the source file resides. The TEMPLATE(*TEMPINC) and TMPLREG parameters are mutually exclusive.
path-name
Specify the path name for the directory where the compiler will generate templates.

Element 2: Maximum generated headers

1
The maximum number of generated headers that contain templates.
1-99999
Specify the maximum number of generated header files.

Element 3: Template validity checking

Controls whether parsing and semantic checking are applied to template definition implementations or only to template instantiations. The compiler has the option to producte warning or error messages. Available parameters are:

*NO
Do not parse to reduce the number of errors issued in code written for previous versions of the compiler.
*WARN
Issue warning messages for semantic errors. Issue error messages for errors found while parsing.
*ERROR
Treat problems in template implementations as errors, even if the template is not instantiated.

Template registry (TMPLREG)

Maintains a record of all templates as they are encountered in the source and ensures that only one instantiation of each template is made. The TMPLREG and TEMPLATE(*TEMPINC) parameters are mutually exclusive.

*NONE
Do not use the template registry file to keep track of template information.
*DFT
If the source file is a stream file, the template registry file is created in the source directory with the default name 'templateregistry'. If the source file is not a stream file, a file QTMPLREG with the member QTMPLREG will be created in the library where the source resides.
path-name
Specify a path name for the stream file in which to store the template registry information.

Weak Template Definitions (WEAKTMPL)

Specifies whether or not weak definitions are used for static members of a template class. Weakly defined static members of a template class will prevent collisions of multiple definitions in a program or service program object.

*YES
Weak definitions will be used for static members of a template class.
*NO
Weak definitions will not be used for static members of a template class.

Decimal float round mode (DECFLTRND)

Specifies the compile-time rounding mode for the evaluation of constant decimal floating-point expressions. This option does not affect the run-time decimal floating-point rounding mode, which is set using the setca built-in function.

*HALFEVEN
Round to the nearest value. In case of a tie, choose even. For example, 5.22 rounds to 5.2, 5.67 rounds to 5.7, 5.55 rounds to 5.6, 5.65 rounds to 5.6.
*DOWN
Round toward zero, or truncate the result. For example, 5.22 rounds to 5.2, 5.67 rounds to 5.6, 5.55 rounds to 5.5, 5.65 rounds to 5.6.
*UP
Round away from zero. For example, 5.22 rounds to 5.3, 5.67 rounds to 5.7, 5.55 rounds to 5.6, 5.65 rounds to 5.7.
*HALFUP
Round to the nearest value. In case of a tie, round away from zero. For example, 5.22 rounds to 5.2, 5.67 rounds to 5.7, 5.55 rounds to 5.6, 5.65 rounds to 5.7.
*HALFDOWN
Round to the nearest value. In case of a tie, round toward zero. For example, 5.22 rounds to 5.2, 5.67 rounds to 5.7, 5.55 rounds to 5.5, 5.65 rounds to 5.6.
*FLOOR
Round toward negative infinity. For example, 5.22 rounds to 5.2, 5.67 rounds to 5.6, 5.55 rounds to 5.5, 5.65 rounds to 5.6.
*CEILING
Round toward positive infinity. For example, 5.22 rounds to 5.3, 5.67 rounds to 5.7, 5.55 rounds to 5.6, 5.65 rounds to 5.7.

Examples

Example 1: Create Module from Source File Member

CRTCPPMOD   MODULE(QTEMP/TEST)  SRCFILE(QTEMP/QCPPSRC)

This command will create a module object named TEST in library QTEMP. The C++ source is located in member TEST of source file QCPPSRC in library QTEMP.

Example 2: Create Module from Stream File

CRTCPPMOD   MODULE(QTEMP/TEST)  SRCSTMF('/tmp/mySrc.C')

This command will create a module object named TEST in library QTEMP. The C++ source is located in the stream file /tmp/mySrc.C.

Example 3: Compile and Generate Compile Listing

CRTCPPMOD   MODULE(TEST)  OUTPUT(*PRINT)  OPTION(*XREF)

This command will create a module object named TEST in the current library of the job, or library QGPL if there is no current library defined. The C++ source is assumed to be located in member TEST of source file QCPPSRC, which will be located using the library list. A spooled file will be generated containing the compiler listing. A cross-reference listing will be contained in the compiler listing file.

Example 4: Create Module with All Debugging Views

CRTCPPMOD   MODULE(QTEMP/TEST)  SRCFILE(QTEMP/QCPPSRC)
            SRCMBR(TESTER)  DBGVIEW(*ALL)

This command will create a module object named TEST in library QTEMP that contains statement, source, and listing views used during debugging. The C++ source is located in member TESTER of source file QCPPSRC in library QTEMP.

Example 5: Create Teraspace-enabled Module

CRTCPPMOD   MODULE(QTEMP/TEST)  SRCFILE(QTEMP/QCPPSRC)
            TERASPACE(*YES *TSIFC)  STGMDL(*TERASPACE)
            DTAMDL(*LLP64)  RTBND(*LLP64)

This command will create a module object named TEST in library QTEMP. The C++ source is located in member TEST of source file QCPPSRC in library QTEMP. The module will be enabled to use teraspace storage. Heap space, automatic storage, and static storage will be located in teraspace storage. The default pointer size will be eight bytes, and the 8-byte runtime will be used.

Example 6: Save Preprocessed Source to a File

CRTCPPMOD   MODULE(TEST)  SRCFILE(QTEMP/QCPPSRC)
            PPGENOPT(*DFT)  PPSRCFILE(QTEMP/QCPPSRC)
            PPSRCMBR(TESTI)

This command will run the compiler preprocessor against the C++ source located in member TEST of source file QCPPSRC in library QTEMP, and store the output source in member TESTI of the same source file. No module object will be created.

Error messages

*ESCAPE Messages

CZS0613
The compilation failed.