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
- You need *READ and *ADD authority for the library where the program is created.
- You need *USE authority to the specified modules, service programs, and binding directories.
Parameters
PGM
Program
Names the program object to create. This parameter is required.
*CURLIB- The job's current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Program
Program
Library
Library
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.
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
Suggested / special values:
*ALL
Library
Library
Suggested / special values:
*LIBL, *CURLIB, *USRLIBL
TEXT
Text 'description'
Briefly describes the program object, in up to 50 characters.
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.
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
Library
Library
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.
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
Qualified parts (object, then library; write LIBRARY/OBJECT)
Service program
Service program
Suggested / special values:
*ALL
Library
Library
Suggested / special values:
*LIBL
Activation
Activation
Allowed values:
*IMMED, *DEFER
BNDDIR
Binding directory
Lists binding directories used in symbol resolution; up to 300 names.
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
Library
Library
Suggested / special values:
*LIBL, *CURLIB, *USRLIBL
ACTGRP
Activation group
Names the activation group the program is associated with when it is called.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Allowed values:
*NO, *YES
*NO- Not performed.
*YES- Performed.
IPA
Interprocedural analysis
Whether interprocedural analysis (IPA) is used during program creation.
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.
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.
Generated from os/cl/catalog/CRTPGM.json and os/cl/help/CRTPGM.json.