Create Bound C Program (CRTBNDC)

The Create Bound C Program (CRTBNDC) command starts the ILE C compiler. The compiler attempts to create a program object based on the ILE C statements in the source code. The full compilation sequence is always run.

Note: When the CRTBNDC command is invoked, a temporary *MODULE object is created in the QTEMP library. The name of the temporary module object is the same as the name specified for the Program (PGM) parameter. If a *MODULE object with that name already exists in QTEMP, an error message is generated and compilation stops. The temporary module object, which is used with the CRTBNDC command, is deleted after compilation stops whether or not compilation is successful.

Parameters

Keyword Description Choices Notes
PGM Program Qualified object name Required, Positional 1
Qualifier 1: Program Name
Qualifier 2: Library Name, *CURLIB
SRCFILE Source file Qualified object name Optional, Positional 2
Qualifier 1: Source file Name, QCSRC
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCMBR Source member Name, *PGM 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): *NOAGR, *AGR, *DIGRAPH, *NODIGRAPH, *NOEVENTF, *EVENTF, *NOEXPMAC, *EXPMAC, *NOFULL, *FULL, *GEN, *NOGEN, *NOINCDIRFIRST, *INCDIRFIRST, *LOGMSG, *NOLOGMSG, *NOSECLVL, *SECLVL, *NOSHOWINC, *SHOWINC, *NOSHOWSKP, *SHOWSKP, *SHOWSRC, *NOSHOWSRC, *NOSHOWSYS, *SHOWSYS, *NOSHOWUSR, *SHOWUSR, *STDINC, *NOSTDINC, *NOSTDLOGMSG, *STDLOGMSG, *NOSTRUCREF, *STRUCREF, *NOSYSINCPATH, *SYSINCPATH, *NOXREF, *XREF, *NOXREFREF, *XREFREF Optional
CHECKOUT Checkout options Values (up to 39 repetitions): *NONE, *USAGE, *ALL, *NOCOND, *COND, *NOCONST, *CONST, *NOEFFECT, *EFFECT, *NOENUM, *ENUM, *NOEXTERN, *EXTERN, *NOGENERAL, *GENERAL, *NOGOTO, *GOTO, *NOINIT, *INIT, *NOPARM, *PARM, *NOPORT, *PORT, *NOPPCHECK, *PPCHECK, *NOPPTRACE, *PPTRACE, *NOREACH, *REACH, *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
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 Optional
ALIAS Alias Values (up to 3 repetitions): *ANSI, *NOANSI, *ADDRTAKEN, *NOADDRTAKEN, *ALLPTRS, *NOALLPTRS, *TYPEPTR, *NOTYPEPTR Optional
SYSIFCOPT System interface options Values (up to 2 repetitions): *NOIFSIO, *IFSIO, *IFS64IO, *NOASYNCSIGNAL, *ASYNCSIGNAL Optional
LOCALETYPE Locale object type *LOCALE, *LOCALEUCS2, *LOCALEUTF, *CLD 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 program object *YES, *NO Optional
USRPRF User profile *USER, *OWNER 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 Optional
DTAMDL Data model *P128, *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
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
DECFLTRND Decimal float round mode *HALFEVEN, *DOWN, *UP, *HALFUP, *HALFDOWN, *FLOOR, *CEILING Optional

Program (PGM)

Specifies the ILE C program object being created.

This is a required parameter.

Qualifier 1: Program

name
Specify a name for the program object.

Qualifier 2: Library

*CURLIB
The program object is stored in the current library. If a job does not have a current library, the program object is created in the QGPL library.
name
Specify the name of the library where the program object being created 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

QCSRC
The source file named QCSRC contains the member with the ILE C source code that you want to compile.
name
Specify the name of the 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 name of the member containing the source code to be compiled.

*PGM
The name specified for the Program (PGM) 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 program object.

*SRCMBRTXT
The text description associated with the source file member is used for the program 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.

*NOAGR
Does not generate aggregate maps in the listing.
*AGR
Generate maps of all aggregates in the listing. The maps include structures and unions. The structure maps show padding of members. This option overrides the *STRUCREF option.
*DIGRAPH
Allow the use of digraphs in the source code.
*NODIGRAPH
Do not allow the use of digraphs in the source code.
*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. CODE/400 uses this file to provide error feedback integrated with the CODE/400 editor. An event file is normally created when you create a module or program object from within CODE/400.
*NOEXPMAC
Macros are not expanded in the listing unless a syntax error is encountered within the macro.
*EXPMAC
Expand all macros in the listing. This parameter conflicts with DBGVIEW(*ALL) and DBGVIEW(*LIST). Compilation will stop with an error message if OPTION(*EXPMAC) is used together with DBGVIEW(*ALL) or DBGVIEW(*LIST).
*NOFULL
Do not turn on all listing options.
*FULL
Turn on all listing options.
*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 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.
*NOSECLVL
Does not generate second-level message text in the listing.
*SECLVL
Generates second-level message text in the listing. An OUTPUT option must be specified for this option to take effect.
*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.
*NOSHOWSKP
Does not include the statements that the preprocessor has ignored in the source section of the listing or in the debug listing view. The preprocessor ignores statements as a result of a preprocessor directive evaluating to false (zero).
*SHOWSKP
Includes all the statements in the source section of the listing or in the debug listing view, regardless of whether or not the preprocessor has skipped them. An OUTPUT option or a DBGVIEW parameter value of *ALL 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 value 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.
*NOSTRUCREF
Do not generate maps of all referenced struct or union variables in the listing file.
*STRUCREF
Generate maps of all referenced struct or union variables in the listing file.
*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 39 values for this parameter.

Note: CHECKOUT may produce many messages. To prevent these messages from going to the job log specify OPTION(*NOLOGMSG *NOSTDLOGMSG) along with an OUTPUT parameter to place the checkout messages in the listing file.

*NONE
Disables all of the options for CHECKOUT.
*USAGE
This is equivalent to specifying *ENUM, *EXTERN, *INIT, *PARM, *PORT, *GENERAL and *TRUNC.
*ALL
Enables all of the options for CHECKOUT.
*NOCOND
Do not warn about possible redundancies or problems in conditional expressions.
*COND
Warn about possible redundancies or problems in conditional expressions.
*NOCONST
Do not warn about operations involving constants.
*CONST
Warn about operations involving constants.
*NOEFFECT
Do not warn about statements with no effect.
*EFFECT
Warn about statements with no effect.
*NOENUM
Does not list the usage of enumerations.
*ENUM
Lists the usage of enumerations.
*NOEXTERN
Does not list the unused variables that have external declarations.
*EXTERN
Lists the unused variables that have external declarations.
*NOGENERAL
Does not list the general checkout messages.
*GENERAL
Lists the general checkout messages.
*NOGOTO
Does not list the occurrence and usage of goto statements.
*GOTO
Lists the occurrence and usage of goto statements.
*NOINIT
Does not list the automatic variables that are not explicitly initialized.
*INIT
Lists the automatic variables that are not explicitly initialized.
*NOPARM
Does not list the function parameters that are not used.
*PARM
Lists the function parameters that are not used.
*NOPORT
Does not list nonportable usage of the C language.
*PORT
Lists nonportable usage of the C language.
*NOPPCHECK
Does not list the preprocessor directives.
*PPCHECK
Lists all preprocessor directives.
*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.
*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.

Debugging view (DBGVIEW)

Specifies which level of debugging is available for the module in the created 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 program object.
*ALL
Enables all of the debug options (*STMT, *SOURCE and *LIST)
*STMT
Allows the program 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 program 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 program object is created.

*LIST
Generates the listing view for debugging the program 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 program 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__ and __STDC__ and undefines other language-level variables. Only ANSI-standard C is made available.

Note: The ILE C compiler always predefines the __ILEC400__ macro.

Alias (ALIAS)

Specifies the aliasing assertion to be applied in the program object being created.

You can specify 3 values for this parameter.

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

*NOIFSIO
The module object will use the Data Management file system for C stream I/O operations.
*IFSIO
The module object will use the Integrated File System for C stream I/O operations.
*IFS64IO
The module object will use the Integrated File System for 64-bit C stream I/O operations.
*NOASYNCSIGNAL
Does not enable runtime mapping of synchronous signalling functions to asynchronous signalling functions.
*ASYNCSIGNAL
Enable runtime mapping of synchronous signalling functions to asynchronous signalling functions. Specifying this option causes C runtime to map the synchronous signal() and raise() functions to the asynchronous sigaction() and kill() functions respectively.

Locale object type (LOCALETYPE)

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

*LOCALE
Program objects created with this option use the locale support provided by *LOCALE objects.
*LOCALEUCS2
Program objects created with this option use the locale support provided by *LOCALE objects. Wide-character types will contain two-byte universal character set values.
*CLD
Program objects created with this option use the locale support provided by *CLD objects.
*LOCALEUTF
Program 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.

Compiler messages (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 program 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.

User profile (USRPRF)

Specifies the user profile that is used when the created program object is run, including the authority that the program object has for each object. The profile of either the program owner or the program user is used to control which objects can be used by the program object.

*USER
The profile of the user running the program object is used.
*OWNER
The user profiles of both the program's owner and the program's user are used when the program object is processed. The collective sets of object authority in both user profiles are used to find and access objects during program processing. Authority from the owning user profile's group profile is not included in the authority for the running program object.

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 program 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 program object is not enabled to collect profiling data.
*COL
The program 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 program object is enabled to work with teraspace storage. This includes teraspace storage allocated by the program object and parameters passed from other teraspace-enabled program and service program objects.

Single values

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

Note: Starting in V6R1M0, all program objects 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 program 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 program object will default to use the non-teraspace versions of the storage functions.
*TSIFC
The program 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.

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__.

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.

Include directory (INCDIR)

Specifies one or more directories to add to the search path used by the compiler to find include files. Use of INCDIR overrides the INCLUDE environment variable.

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 (CCSID) used to describe data stored into the resulting program 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.

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 Program from Source File Member

CRTBNDC   PGM(QTEMP/TEST)  SRCFILE(QTEMP/QCSRC)

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

Example 2: Create Program from a Stream File

CRTBNDC   PGM(QTEMP/TEST)  SRCSTMF('/tmp/mySrc.c')

This command will create a program 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

CRTBNDC   PGM(TEST)  OUTPUT(*PRINT)  OPTION(*XREF)

This command will create a program 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 QCSRC, 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 Program with All Debugging Views

CRTBNDC   PGM(QTEMP/TEST)  SRCFILE(QTEMP/QCSRC)
          SRCMBR(TESTER)  DBGVIEW(*ALL)

This command will create a program 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 QCSRC in library QTEMP.

Example 5: Create Teraspace-enabled Program

CRTBNDC   PGM(QTEMP/TEST)  SRCFILE(QTEMP/QCSRC)
          TERASPACE(*YES *TSIFC)  STGMDL(*TERASPACE)
          DTAMDL(*LLP64)

This command will create a program object named TEST in library QTEMP. The C source is located in member TEST of source file QCSRC 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.

Error messages

*ESCAPE Messages

CZM1613
The compilation failed.