Release the NEW Power of CL

Release the NEW Power of CL

Name:

Email:

Profile Manager

Stop spending time and money reinstating user profiles!

Try Profile Manager Today!

30 DAY FREE TRIAL

Learn More

Programming Services

Do you need a program written?

Bruce Vining Services can provide highly experienced IBM i developers to supplement your staff with short term contracts. If you are looking for custom solutions involving system functions such as communications, database, security, encryption, print, and work management you will find your answers at Bruce Vining Services.

PDF Print E-mail

Create CLF Program (CRTCLFPGM)

Where allowed to run: All environments (*ALL)
Threadsafe: Yes
Parameters
Examples
Error messages

The Create CLF Program (CRTCLFPGM) command creates an Original Program Model (OPM) Control Language (CL) program from the specified CL source program.

Most of the parameters are passed to the Create CL Program (CRTCLPGM) command after the source file has been processed by the CLF precompiler. The parameters used by the precompiler are PGM, SRCFILE, SRCMBR, TGTRLS, OPTION, INCFILE, and TEXT.

Due to the similarity in names between CRTCLFPGM and the IBM provided CRTCLPGM command the proxy command, CLFO, can also be used to create an OPM CLF application program.

Top

Parameters

KeywordDescriptionChoicesNotes
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, QCLSRC
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCMBR Source member Name, *PGM Optional, Positional 3
TEXT Text 'description' Character value, *SRCMBRTXT, *BLANK Optional
OPTION Source listing options Values (up to 6 repetitions): *SOURCE, *NOSOURCE, *SRC, *NOSRC, *XREF, *NOXREF, *GEN, *NOGEN, *SECLVL, *NOSECLVL, *SRCDBG, *NOSRCDBG, *LSTDBG, *NOLSTDBG Optional
GENOPT Generation Options Values (up to 3 repetitions): *NOLIST, *LIST, *NOXREF, *XREF, *NOPATCH, *PATCH Optional
USRPRF User profile *USER, *OWNER Optional
LOG Log commands *JOB, *YES, *NO Optional
ALWRTVSRC Allow RTVCLSRC *YES, *NO Optional
REPLACE Replace program *YES, *NO Optional
TGTRLS Target release Simple name, *CURRENT, *PRV Optional
AUT Authority *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE Optional
SRTSEQ Sort sequence Single values: *HEX, *JOB, *JOBRUN, *LANGIDUNQ, *LANGIDSHR
Other values: Qualified object name
Optional
Qualifier 1: Sort sequence Name
Qualifier 2: Library Name, *LIBL, *CURLIB
LANGID Language ID Character value, *JOBRUN Optional
INCFILE Include file Qualified object name Optional
Qualifier 1: Include file Name, *SRCFILE
Qualifier 2: Library Name, *LIBL, *CURLIB
Top

Program (PGM)

Specifies the program to be created.

This is a required parameter.

Qualifier 1: Program

name
Specify the name of of the program to be created.

Qualifier 2: Library

*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
Specify the library where the program is to be stored.
Top

Source file (SRCFILE)

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

The source file must have been created with a RCDLEN between 92 and 512 inclusively.

Qualifier 1: Source file

QCLSRC
The source file named QCLSRC, that contains the CL source member to be compiled, is used.
name
Specify the name of the source file that contains the CL source member to be compiled. The source must be a source physical file.

Qualifier 2: Library

*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
Specify the name of the library to be searched.
Top

Source member (SRCMBR)

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

*PGM
The CL source program to be compiled is in the member of the source file that has the same name as that specified on the Program (PGM) parameter.
name
Specify the name of the member that contains the CL source program, if the member name is not the same as the name of the program to be created.
Top

Text 'description' (TEXT)

Specifies text that briefly describes the compiled CL program.

*SRCMBRTXT
The text is taken from the source file member used to create the CL program.
*BLANK
Text is not specified.
'description'
Specify no more than 50 characters of text, enclosed in apostrophes.
Top

Source listing options (OPTION)

Specifies the types of output lists created when this command is processed and whether a program is created.

You can specify multiple values for this parameter.

Source Listing Option
*SRC or *SOURCE
The compiler creates a listing of the source input used to compile the program.
*NOSRC or *NOSOURCE
A complete compiler source listing is not created; only compiler errors are listed.
Cross Reference Option
*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 the source program is produced.
Program Creation Option
*GEN
The compiler creates a program and places it in the specified library.
*NOGEN
No program is created.
Second-Level Message Text Option
*NOSECLVL
No second level message text is printed.
*SECLVL
Second-level message text is printed.

The source listing for the CLF precompiler ignores this option. The CLF precompiler source listing only provides first level message text. Full message text is provided in the job log.

Source-Level Debug Option
*NOSRCDBG
Source-level debug information is not generated.
*SRCDBG
Source-level debug information is generated. This value is provided for compatibility with the CRTCLPGM command. The *SRCDBG information however will not be of practical value due to the use of temporary source file members when expanding CLF-related commands during the precompilation process.

The *SRCDBG view will only be available to the job that runs the CRTCLFPGM command and only so long as no additional compiles using CRTCLFPGM or CRTBNDCLF are performed.

Listing-Level Debug Option
*NOLSTDBG
A listing view is not generated.
*LSTDBG
A listing view is generated.
Top

Generation Options (GENOPT)

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.

IRP/MI Listing Option
*SRC or *NOLIST
No listing of the intermediate representation of the program (IRP) is created.
*LIST
A lising of the intermediate representation of the program (IRP), including the generated machine interface (MI) instructions, is created.
IPR/MI Cross-Reference Option
*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.
Program Patch Area Option
*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.
Top

User profile (USRPRF)

Specifies whether the authority checking done while this program is running includes only the user who is running the program (*USER) or both the user 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 the objects that can be used by the program, including the authority the program has for each object. Only the program owner or a user with QSECOFR authority can change the user profile attribute.

This parameter is ignored if REPLACE(*YES) is specified and a program by the same name does exist in the specified PGM library.

*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 running. The collective sets of object authority in both user profiles are used to find and access object during program processing. Authority from the owning user profile's group profile is not included in the authority for the running program.
Top

Log commands (LOG)

Specifies the logging options for a created CL program.

*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). To list the logged commands, the logging level of the job must be 3 or 4.

A *YES or *NO value takes precedence over any value specified in the CHGJOB command.

*YES
The commands are logged in all cases.
*NO
The commands are not logged.
Top

Allow RTVCLSRC (ALWRTVSRC)

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

*YES
Source for the CL program is saved with the program.
*NO
Source for the CL program is not saved with the program.
Top

Replace program (REPLACE)

Specifies whether an existing program is replaced if a program with the same name already exists in the specified library.

*YES
The existing program is replaced by moving it to the QRPLOBJ library.

Specifying *YES causes the USRPRF and AUT parameter to be ignored when replacing an existing program. The existing program is used as the source of authority, and the user profile attribute is copied from the exiting program to the new program.

*NO
The existing program is not replaced. When a program with the same name exists in the specified library, a message is generated and the compilation stops.
Top

Target release (TGTRLS)

Specifies the release of the operating system that you intend to use the object being created on.

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 V5R4M0 is version 5, release 4, modification 0.

*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 level with modification leval 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.
Top

Authority (AUT)

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.

*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.
*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.
*USE
The user can perform basic functions on the object, such as running the program. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.
Top

Sort sequence (SRTSEQ)

Specifies the sort sequence table to be used for string comparisions for this CL program. The sort sequence value is used with the language identifier and the coded character set identifier of the job to determine the sort sequence table to use.

Single values

*HEX
A sort sequence table is not used.
*JOB
The sort sequence used is the SRTSEQ associated with the job when the CL program is created.
*JOBRUN
The sort sequence used is the SRTSEQ associated with the job when the CL program is run.
*LANGIDUNQ
The sort sequence table uses a unique weight for each character, and is the unique-weight sort table for the language specified for the LANGID parameter.
*LANGIDSHR
The sort sequence table uses the same weight for multiple characters, and is the shared-weight sort sequence table associated with the LANGID parameter.

Qualifier 1: Sort sequence

name
Specify the name of the sort sequence table to be used with this CL program.

Qualifier 2: Library

*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 searched. If no library is specified as the current library for the thread, the QGPL library is searched.
name
Specify the name of the library to be searched.
Top

Language ID (LANGID)

Specifies the language identifier to be used when SRTSEQ(*LANGIDUNQ) or SRTSEQ(*LANGIDSHR) is specified.

*JOBRUN
The language ID used is the LANGID associated with the job when the CL program runs.
language-ID
Specify the language identifier to be used by the program.
Top

Include file (INCFILE)

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

Single Values

*SRCFILE
The source file specified for the Source file (SRCFILE) parameter contains the source file members specified on any CL INCLUDE commands.

Qualifier 1:Include file

name
Specify the name of the source file that contains the source file member specified on any CL INCLUDE commands.

Qualifier 2:Library

*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
Specify the name of the library to be searched.
Top

Examples for CRTCLFPGM

Example 1: Create an OPM Program to Load the CLF sample databases

 

    CrtCLFPgm  Pgm(DEV_LOAD)

 

This command calls the CLF precompiler to generate a CL program capable of file operations.

Top

Error messages for CRTCLFPGM

*ESCAPE Messages

VC25013
Unexpected error in command &1.
VC25031
Cannot open member &3 of file &1 in library &2.
VC25032
File &1 in library &2 is not a source file.
VC25033
The &1 command does not support a SRCFILE record length of &2.
VC29002
Function did not complete. See previously listed messages related to possible user errors.
VC29003
Function did not complete. See previously listed messages for possible cause.
VC29004
Function did not complete. See previously listed messages for possible cause.
VC29005
Function did not complete. Contact your service provider.
Top
 
Joomla 1.5 Templates by Joomlashack