Command reference / prog

CRTPGM

Create Program

Creates a bound program from a set of modules and binding directories.

Allowed environments: *ALL. Positional parameters: 1.

Restrictions

Parameters

PGM Program

Names the program object to create. This parameter is required.

Type
*QUAL
Required
Yes
Case
Uppercase
*CURLIB
The job's current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Program Program

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *CURLIB

MODULE Module

Lists the modules copied and bound together into the program; up to 300 names. If a module and library pair is duplicated, only the first is used.

Type
*QUAL
Required
No
Default
*PGM
List limit
300
Case
Uppercase

Suggested / special values: *PGM

*PGM
Use the PGM name as the module name.
*ALL
Find all modules in the specified library or libraries.
*LIBL
Search the library list.
*CURLIB
Search the job's current library, or QGPL if none is set.
*USRLIBL
Search only the user portion of the library list.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Module Module

Type
*GENERIC
Required
No
Length
10
Case
Uppercase

Suggested / special values: *ALL

Library Library

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

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

TEXT Text 'description'

Briefly describes the program object, in up to 50 characters.

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

Suggested / special values: *ENTMODTXT, *BLANK

*ENTMODTXT
Use the text of the ENTMOD module.
*BLANK
No text.

ENTMOD Program entry procedure module

Names the module that contains the program entry procedure specification.

Type
*QUAL
Required
No
Default
*FIRST
Case
Uppercase

Suggested / special values: *FIRST, *ONLY, *PGM

*FIRST
The first module in the list that has a program entry procedure.
*ONLY
Only one module may have it; an error occurs if more than one does.
*PGM
The module named on the PGM parameter.
*LIBL
Search the library list.
*CURLIB
Search the job's current library, or QGPL if none is set.
*USRLIBL
Search only the user portion of the library list.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Program entry procedure module Program entry procedure module

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

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

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

BNDSRVPGM Bind service program

Lists service programs whose exports are checked at bind time to satisfy module import requests; up to 300 names. Each element also sets activation timing.

Type
*ELEM
Required
No
Default
*NONE
List limit
300
Case
Uppercase

Suggested / special values: *NONE

*NONE
No service program.
*ALL
Find all service programs in the specified library or libraries.
*LIBL
Search the library list.
*IMMED
Activate when the program is activated.
*DEFER
Activation may be deferred until an export is called.
Elements in order

Service program Service program

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Service program Service program

Type
*GENERIC
Required
No
Length
10
Case
Uppercase

Suggested / special values: *ALL

Library Library

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

Suggested / special values: *LIBL

Activation Activation

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

Allowed values: *IMMED, *DEFER

BNDDIR Binding directory

Lists binding directories used in symbol resolution; up to 300 names.

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

Suggested / special values: *NONE

*NONE
No binding directory.
*LIBL
Search the library list.
*CURLIB
Search the job's current library, or QGPL if none is set.
*USRLIBL
Search only the user portion of the library list.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Binding directory Binding directory

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

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

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

ACTGRP Activation group

Names the activation group the program is associated with when it is called.

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

Suggested / special values: *ENTMOD, *NEW, *CALLER

*ENTMOD
Chosen from the entry procedure module's attribute (QILE or QILETS for ILE RPG and CL, otherwise *NEW).
*NEW
A new activation group is created when the program is called.
*CALLER
The program runs in the caller's activation group.

OPTION Creation options

Options used when the program object is created; up to six values.

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

Allowed values: *GEN, *NOGEN, *NODUPPROC, *DUPPROC, *NODUPVAR, *DUPVAR, *WARN, *NOWARN, *RSLVREF, *UNRSLVREF, *NOEVENTF, *EVENTF

*GEN
Generate a program object.
*NOGEN
Do not generate a program object.
*NODUPPROC
Exported procedure names must be unique during symbol resolution.
*DUPPROC
Exported procedure names need not be unique.
*NODUPVAR
Exported variable names must be unique during symbol resolution.
*DUPVAR
Exported variable names need not be unique.
*WARN
Issue a diagnostic message for duplicate variables or procedures.
*NOWARN
No diagnostic message for duplicates.
*RSLVREF
All imports must resolve to exports.
*UNRSLVREF
Imports need not resolve; an MCH4439 exception occurs if one is used at run time.
*NOEVENTF
No event file for client tooling.
*EVENTF
Create an event file for client tooling in EVFEVENT.

DETAIL Listing detail

Level of detail printed in the listing.

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

Allowed values: *NONE, *BASIC, *EXTENDED, *FULL

*NONE
No listing.
*BASIC
Options passed to CRTPGM, processing statistics and the Brief Summary Table.
*EXTENDED
Adds the Extended Summary Table and Binding Information Listing.
*FULL
Adds the Cross-Reference Listing.

ALWUPD Allow update

Whether the program can be updated later with the UPDPGM command.

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

Allowed values: *YES, *NO

*YES
UPDPGM can update the program.
*NO
UPDPGM cannot update the program.

ALWLIBUPD Allow *SRVPGM library update

Whether UPDPGM may change the bound service program library names when ALWUPD(*YES) is set.

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

Allowed values: *NO, *YES

*NO
UPDPGM may not change the library names.
*YES
UPDPGM may change the library names.

USRPRF User profile

Whether authority checks while the program runs include only the user running it, or also the program owner.

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

Suggested / special values: *USER, *OWNER

*USER
The program runs under the user profile of the program's user.
*OWNER
Both the program owner's and the program user's profiles are used.

REPLACE Replace program

Whether an existing program of the same name in the library is replaced.

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

Allowed values: *YES, *NO

*YES
The existing program is moved to QRPLOBJ; current activations keep using it.
*NO
No replacement; an error is issued if the program exists.

AUT Authority

Authority given to users with no specific authority, who are not on an authorization list, and whose group profiles have no specific authority.

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

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

*LIBCRTAUT
Take the CRTAUT value of the library.
*CHANGE
All data authority and most operations, except owner-limited ones.
*ALL
All operations except authorization list management.
*USE
Basic operations such as running the program; cannot change it.
*EXCLUDE
No access.

TGTRLS Target release

Operating system release on which the object will be used, in VxRxMx format.

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

Suggested / special values: *CURRENT, *PRV

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

ALWRINZ Allow reinitialization

Whether the program's static storage may be reinitialized while it is still active.

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

Allowed values: *NO, *YES

*NO
Static storage cannot be reinitialized while active.
*YES
Static storage may be reinitialized while active.

STGMDL Storage model

Storage model attribute of the program.

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

Allowed values: *SNGLVL, *TERASPACE, *INHERIT

*SNGLVL
Single-level storage; runs only in a single-level storage activation group.
*TERASPACE
Teraspace storage; runs only in a teraspace activation group.
*INHERIT
Adopts the storage model of the activation group it is activated into; requires ACTGRP(*CALLER).

ARGOPT Argument optimization

Whether argument optimization is performed during program creation, to speed up call-intensive applications. It may lengthen creation time.

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

Allowed values: *NO, *YES

*NO
Not performed.
*YES
Performed.

IPA Interprocedural analysis

Whether interprocedural analysis (IPA) is used during program creation.

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

Allowed values: *NO, *YES

*NO
Not performed.
*YES
Performed.

IPACTLFILE IPA control file

Path name of a file with IPA suboption information. Allowed only when IPA(*YES) is specified.

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

Suggested / special values: *NONE

*NONE
No IPA control file information is used.

Examples

CRTPGM PGM(STAR)

Creates program STAR in the current library, or QGPL if none is set. It is built from one module named STAR, located through the current library.

IBM command documentation

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