CL Command Reference - CRTCLPGM
CL Command List > CRTCLPGM Reference
Description:
The Create CL Program (CRTCLPGM) command creates a Control Language (CL) program from the specified CL source program.
Restrictions: The amount of auxiliary storage occupied by a compiled program varies with the number of commands in the program, the kinds of functions performed by the commands (for example: display, create, add, and call), and the kinds of parameter values specified (variables versus constants). Some combinations of these factors can cause the system internal size limits for the program to be exceeded (an unlikely occurrence). When the limits are exceeded, the program must be rewritten, usually as multiple programs instead of one program.
Examples:
Example 1: Creating a Program to be Run by Any System User
CRTCLPGM PAYROLL TEXT(¡¯Payroll Program¡¯)
This command calls the CL compiler to create a program named PAYROLL. The 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.
Example 2: Creating a Program to be Run by an Authorized 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.
Example 3: Creating a Program to be Run on a Previous Release System
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.