Command reference / prog

CRTCLPGM

Create CL Program

The Create CL Program (CRTCLPGM) command creates a Control Language (CL) program from the specified CL source program.

Allowed environments: *ALL. Positional parameters: 5.

Restrictions

Parameters

PGM Program

Specifies the program to be created. This is a required parameter.

Type
*QUAL
Required
Yes
Case
Uppercase
name (Program)
Specify the name of the program to be created.
*CURLIB
The program is stored in the current library for the job. If no current library entry exists in the library list, QGPL is used.
name (Library)
Specify the library where the program is to be stored.
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

SRCFILE Source file

Specifies the source file that contains the CL source member to be compiled.

Type
*QUAL
Required
No
Case
Uppercase
QCLSRC
The source file named QCLSRC, that contains the CL source member to be compiled, is used.
name (Source file)
Specify the name of the source file that contains the CL source member to be compiled. The source file can be a database file, a device file, or an inline data file.
*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is used to locate the source file. If no library is specified as the current library for the thread, the QGPL library is used.
name (Library)
Specify the name of the library to be searched.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Source file Source file

Type
*NAME
Required
No
Default
QCLSRC
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *LIBL, *CURLIB

SRCMBR Source member

Specifies the name of the source member (of the source file) that contains the CL source program to be compiled.

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

Suggested / special values: *PGM

*PGM
The job name is the same as the program name specified for the Program (PGM) parameter.
name
If the member name is not the same as the name of the program to be created, specify the name of the member that contains the CL source program.

OUTPUT Output

Specifies whether or not a compiler listing is produced.

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

Allowed values: *PRINT, *NONE

*PRINT
The compiler listing is produced. The information contained in the listing will be dependent on the values specified for the Source listing options (OPTION) parameter.
*NONE
The compiler listing is not produced. When a listing is not required, this option should be used because compile-time performance may be better.

OPTION Source listing options

Specifies the types of output listings created when this command is processed, and if a program is created when this command is processed. Multiple option values can be specified in any order on this parameter. If neither or both of the values in each group are specified, the underlined value will be used. Note: The underlined values for this parameter are similar to, but not actually default values, and therefore, cannot be changed with the Change Command Default (CHGCMDDFT) command.

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

Allowed values: *SOURCE, *NOSOURCE, *SRC, *NOSRC, *XREF, *NOXREF, *GEN, *NOGEN, *SECLVL, *NOSECLVL, *SRCDBG, *NOSRCDBG, *LSTDBG, *NOLSTDBG, *DOSLTLVL, *NODOSLTLVL

*SRC
The compiler creates a listing of the source input used to compile the program.
*SOURCE
The compiler creates a listing of the source input used to compile the program.
*NOSRC
A complete compiler source listing is not created; only compiler errors are listed.
*NOSOURCE
A complete compiler source listing is not created; only compiler errors are listed.
*XREF
The compiler creates a cross-reference listing of references to variables or labels in the source. If *NOSOURCE is specified, *NOXREF is always assumed.
*NOXREF
No cross-reference listing of references to variables and data items in the source is created.
*GEN
The compiler creates a program and places it in the appropriate library.
*NOGEN
No program is created. The compiler is to syntax check the source and (if *SOURCE or *SRC option is specified) produce a source listing.
*NOSECLVL
No second-level message text will be printed.
*SECLVL
Second-level text will be printed, along with first-level text, for compiler errors.
*NOSRCDBG
Source-level debug information is not generated. Source-level error information will not be generated unless *LSTDBG is specified.
*SRCDBG
The compiler generates source-level error and debug information for use with CoOperative Development Environment/400 (CODE/400). Source-level or listing-level debugging information is also necessary if you want to use the source-level debug function of the system debugger (STRDBG OPMSRC(*YES)) to debug OPM programs. An event file is created even if the compiler completes the process without error.
*NOLSTDBG
A listing view or listing-level debugging information is not generated. Source-level error information will not be created unless *SRCDBG is specified.
*LSTDBG
The compiler generates a listing view, source-level error information, and listing-level debugging information for use with CoOperative Development Environment/400 (CODE/400). Source-level or listing-level debugging information is also necessary if you want to use the source-level debug function of the system debugger (STRDBG OPMSRC(*YES)) to debug OPM programs.
*NODOSLTLVL
The compiler does not add the new columns DO SLT into the spooled file printed. DO and SELECT nesting level are not indicated.
*DOSLTLVL
The compiler adds the new columns DO SLT into the spooled file in order to indicate the DO and SELECT nesting level. The column DO indicates the Do level starting for every Do Group, Do For, Do Until and Do While and finishing at the corresponding End Do Group. The column SLT indicates the SELECT level starting for every Select and finishing at the corresponding End Select.

TEXT Text 'description'

Specifies the text that briefly describes the object.

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

Suggested / special values: *SRCMBRTXT, *BLANK

*SRCMBRTXT
The text is taken from the source file member used to create the CL program.
*BLANK
No text is specified.
character-value
Specify no more than 50 characters of text, enclosed in apostrophes.

GENOPT Generation options

Specifies the program generation options to be used. These values are ignored if OPTION(*NOGEN) is specified. Multiple option values can be specified in any order on this parameter. If neither or both of the values in each group are specified, the underlined value will be used. Note: The underlined values for this parameter are similar to, but not actually default values, and therefore, cannot be changed with the Change Command Default (CHGCMDDFT) command.

Type
*CHAR
Required
No
Length
8
List limit
3
Case
Uppercase

Allowed values: *NOLIST, *LIST, *NOXREF, *XREF, *NOPATCH, *PATCH

*NOLIST
No listing of the intermediate representation of the program (IRP) is created.
*LIST
A listing of the intermediate representation of the program (IRP), including the generated machine interface (MI) instructions, is created.
*NOXREF
No cross-reference listing of variable and data item references in the intermediate representation of the program is created.
*XREF
A cross-reference listing of variable and data item references in the intermediate representation of the program is created.
*NOPATCH
No space is to be reserved in the compiled program for a program patch area.
*PATCH
Space is reserved in the compiled CL program for a program patch area.

USRPRF User profile

Specifies whether the authority checking done while this program is running should include only the user who is running the program (*USER) or both the user who is running the program and the program owner (*OWNER). The profiles of the program user or both the program user and the program owner are used to control which objects can be used by the program, including the authority the program has for each object. Note: This parameter is ignored if REPLACE(*YES) is specified.

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

Allowed values: *USER, *OWNER

*USER
The program runs under the user profile of the program's user.
*OWNER
The user profiles of both the program's owner and the program's user are used when the program 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.

LOG Log commands

Specifies the logging options for a created CL program. *YES or *NO specified here takes precedence over any value specified in the Change Job (CHGJOB) command.

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

Allowed values: *JOB, *YES, *NO

*JOB
Logging of commands in a running CL program depends on the status of the job's logging flag (see the LOGCLPGM parameter of the Change Job (CHGJOB) command).
*YES
Commands are logged in all cases.
*NO
Commands are not logged.

ALWRTVSRC Allow RTVCLSRC

Specifies whether the CL source is saved with the program object. Source that is saved can be retrieved later by using the Retrieve CL Source (RTVCLSRC) command.

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

Allowed values: *YES, *NO

*YES
CL source is saved with the program.
*NO
CL source is not saved with the program.

REPLACE Replace program

Specifies, if a program by the same name already exists in the specified library, whether the existing program is replaced. Notes: If a running CL program is recompiled with *YES specified for the REPLACE parameter, message queue errors may occur in the running CL program. Specifying *YES for this parameter will cause the values of the User profile (USRPRF) parameter and Authority (AUT) parameter to be ignored. The existing program is used as the source of authority, and the user profile attribute is copied from the existing program to the new program. Use the Change Program (CHGPGM) command to change the user profile and the Grant Object Authority (GRTOBJAUT) or Revoke Object Authority (RVKOBJAUT) commands to change the authority for the program.

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

Allowed values: *YES, *NO

*YES
Replace the existing program by moving it to the QRPLOBJ library.
*NO
Do not replace an existing program by the same name in the specified library.

TGTRLS Target release

Specifies the release of the operating system on which you intend to use the object being created. When specifying the target-release 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, V5R3M0 is version 5, release 3, modification 0. Valid values depend on the current version, release, and modification level of the operating system, and they change with each new release. You can press F4 while prompting this command parameter to see a list of valid target release values.

Type
*SNAME
Required
No
Default
*CURRENT
Length
10
Case
Uppercase

Suggested / special values: *CURRENT, *PRV

*CURRENT
The object is to be used on the release of the operating system currently running on your system. The object can also be used on a system with any subsequent release of the operating system installed.
*PRV
The object is to be used on the previous release with modification level 0 of the operating system. The object can also be used on a system with any subsequent release of the operating system installed.
character-value
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.

AUT Authority

Specifies the authority you are granting to the users who do not have specific authority for the object, who are not on the authorization list, and whose user group has no specific authority for the object. Note: This parameter is ignored when REPLACE(*YES) is specified.

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

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

*LIBCRTAUT
The system determines the authority for the object by using the value specified for the Create authority (CRTAUT) parameter on the Create Library (CRTLIB) command for the library containing the object to be created. If the value specified for the CRTAUT parameter is changed, the new value will not affect any existing objects.
*CHANGE
The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
*USE
The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.
name
Specify the name of an authorization list to be used for authority to the object. Users included in the authorization list are granted authority to the object as specified in the list. The authorization list must exist when the object is created.

INCFILE INCLUDE file

Specifies the source file that contains members to be included in the program using Include CL Source (INCLUDE) commands.

Type
*QUAL
Required
No
Default
*SRCFILE
Case
Uppercase

Suggested / special values: *SRCFILE

*SRCFILE
The source file specified for the Source file (SRCFILE) parameter contains the source file members specified on any CL INCLUDE commands.
name (INCLUDE file)
Specify the name of the source file that contains the source file member specified on any CL INCLUDE commands. The record length of the source file you specify here must be greater than or equal to the record length of the source file specified for the SRCFILE parameter.
*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is used to locate the source file. If no library is specified as the current library for the thread, the QGPL library is used.
name (Library)
Specify the name of the library to be searched.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Part 13-01

Type
*NAME
Required
No
Length
10
Case
Uppercase

Part 13-11

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

Suggested / special values: *LIBL, *CURLIB

Examples

CRTCLPGM PAYROLL TEXT('Payroll Program')

This command calls the CL compiler to create a program named PAYROLL. The CL program or ILE CL procedure source is in the default source file QCLSRC in the member PAYROLL. A compiler listing is created. The program is processed under the program user's user profile and can be run by any system user.

CRTCLPGM PGM(PARTS) SRCFILE(MYLIB/PARTDATA) AUT(*EXCLUDE) TEXT('This program displays all parts data')

This command creates a CL program named PARTS and stores it in the current library. The source for the program is in the PARTS member of the source file PARTDATA in the library MYLIB. A compiler listing is created. This program can be processed under the profile of the user that is running the program, who could be the owner or another user to which the owner has granted specific authorization by name in the Grant Object Authority (GRTOBJAUT) command.

CRTCLPGM PGM(MYPGM) SRCFILE(MYLIB/MYDATA) TGTRLS(*PRV)

This command creates a CL program that can be saved for a previous release system, restored on that system, and run on that system.

IBM command documentation

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