CL Programming

CL Commands

The following is a list of commands that are frequently used in CL procedures. You can use this list to select the appropriate command for the function you want. IBM provides online information on how to determine the command you might need. Refer to the CL section of the Programming category in the iSeries Information Center for this information. Familiarity with the function of these commands will help you to understand subsequent topics in this chapter. Superscript 1 indicates the commands that you can use only in CL programs and procedures.

System Function Command Command Function
Change Procedure Control CALL (Call) Calls a program

CALLPRC (Call Procedure) 1 Calls a procedure.

RETURN (Return) Returns to the command following the command that caused a program or procedure to be run
CL Procedure Limits PGM (Program) 1 Indicates the start of CL procedure source

ENDPGM (End Program) 1 Indicates the end of CL procedure source
CL Procedure Logic IF (If) 1 Processes commands based on the value of a logical expression

ELSE (Else) 1 Defines the action to be taken for the else (false) condition of an IF command

DO (Do) 1 Indicates the start of a Do group

ENDDO (End Do) 1 Indicates the end of a Do group

GOTO (Go To) 1 Branches to another command
CL Procedure Variables CHGVAR (Change Variable)1 Changes the value of a CL variable

DCL (Declare) 1 Declares a variable
Conversion CHGVAR (Change Variable)1 Changes the value of a CL variable

CVTDAT (Convert Date) 1 Changes the format of a date
Data Areas CHGDTAARA (Change Data Area) Changes a data area

CRTDTAARA (Create Data Area) Creates a data area

DLTDTAARA (Delete Data Area) Deletes a data area

DSPDTAARA (Display Data Area) Displays a data area

RTVDTAARA (Retrieve Data Area) 1 Copies the content of a data area to a CL variable
Files ENDRCV (End Receive) 1 Cancels a request for input previously issued by a RCVF, SNDF, or SNDRCVF command to a display file

DCLF (Declare File) 1 Declares a display or database file

RCVF (Receive File) 1 Reads a record from a display or database file

RTVMBRD (Retrieve Member Description) 1 Retrieves a description of a specific member of a database file

SNDF (Send File) 1 Writes a record to a display file

SNDRCVF (Send/Receive File) 1 Writes a record to a display file and reads that record after the user has replied

WAIT (Wait) 1 Waits for data to be received from an SNDF, RCVF, or SNDRCVF command issued to a display file
Messages MONMSG (Monitor Message) 1 Monitors for escape, status, and notify messages sent to a program's message queue

RCVMSG (Receive Message) 1 Copies a message from a message queue into CL variables in a CL procedure

RMVMSG (Remove Message) 1 Removes a specified message from a specified message queue

RTVMSG (Retrieve Message) 1 Copies a predefined message from a message file into CL procedure variables

SNDPGMMSG (Send Program Message) 1 Sends a program message to a message queue

SNDRPY (Send Reply) 1 Sends a reply message to the sender of an inquiry message

SNDUSRMSG (Send User Message) Sends an informational or inquiry message to a display station or system operator
Miscellaneous Commands CHKOBJ (Check Object) Checks for the existence of an object and, optionally, the necessary authority to use the object

PRTCMDUSG (Print Command Usage) Produces a cross-reference listing for a specified group of commands used in a specified group of CL procedures

RTVCFGSRC (Retrieve Configuration Source) Generates CL command source for creating existing configuration objects and places the source in a source file member

RTVCFGSTS (Retrieve Configuration Status) 1 Gives applications the capability to retrieve configuration status from three configuration objects: line, controller, and device.

RTVJOBA (Retrieve Job Attributes) 1 Retrieves the value of one or more job attributes and places the values in a CL variable

RTVSYSVAL (Retrieve System Value) 1 Retrieves a system value and places it into a CL variable

RTVUSRPRF (Retrieve User Profile) 1 Retrieves user profile attributes and places them into CL variables
Program Creation Commands CRTCLMOD (Create CL Module) Creates a CL module

DLTMOD (Delete Module) Deletes a module

DLTPGM (Delete Program) Deletes a program

CRTBNDCL (Create Bound Control Language Program) Creates a bound CL program.

CRTCLPGM (Create CL Program) Creates an OPM CL program.

CRTPGM (Create Program) Creates a program from one or more modules.

CRTSRVPGM (Create Service Program) Creates a service program from one or more modules.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]