Professional Documents
Culture Documents
CL Commands: System Function Command Command Function
CL Commands: System Function Command Command Function
Command
Command Function
CALL (Call)
Calls a program
CALLPRC (Call
Procedure) 1
Calls a procedure.
CL Procedure
Logic
IF (If) 1
Processes commands
based on the value of a
logical expression
ELSE (Else) 1
DO (Do) 1
CL Procedure
Variables
Conversion
Branches to another
command
CHGVAR
(Change
Variable)1
DCL (Declare) 1
Declares a variable
CHGVAR
(Change
Variable)1
CHGDTAARA
(Change Data
Area)
CRTDTAARA
(Create Data
Area)
DLTDTAARA
(Delete Data
Area)
Files
DSPDTAARA
(Display Data
Area)
RTVDTAARA
(Retrieve Data
Area) 1
ENDRCV (End
Receive) 1
DCLF (Declare
File) 1
Declares a display or
database file
RCVF (Receive
File) 1
RTVMBRD
Retrieves a description of a
(Retrieve Member specific member of a
Description) 1
database file
SNDF (Send File) Writes a record to a display
1
file
SNDRCVF
(Send/Receive
File) 1
WAIT (Wait) 1
Messages
MONMSG
(Monitor
Message) 1
RCVMSG
(Receive
Message) 1
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
SNDRPY (Send
Reply) 1
SNDUSRMSG
(Send User
Message)
Sends an informational or
inquiry message to a display
station or system operator
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
RTVJOBA
(Retrieve Job
Attributes) 1
RTVSYSVAL
Retrieves a system value
(Retrieve System and places it into a CL
Value) 1
variable
Program
Creation
Commands
RTVUSRPRF
(Retrieve User
Profile) 1
CRTCLMOD
(Create CL
Module)
Creates a CL module
Program)
CRTBNDCL
Creates a bound CL
(Create Bound
program.
Control Language
Program)
CRTCLPGM
(Create CL
Program)
Creates an OPM CL
program.
Using CL Procedures
CL programming is a flexible tool allowing you to perform a variety of
operations. Each of the following uses is described in greater detail in
individual sections later in this chapter. In general, you can:
Use variables, logic control commands, expressions, and builtin functions to manipulate and process data within a CL
procedure:
PGM
DCL &C *LGL
DCL &A *DEC VALUE(22)
DCL &B *CHAR VALUE(ABCDE)
*
*
*
CHGVAR &A (&A + 30)
*
*
*
IF (&A < 50) THEN(CHGVAR &C '1')
*
DSPLIB ('Q' || &B)
*
IF (%SST(&B 5 1)=E) THEN(CHGVAR &A 12)
*
*
*
ENDPGM
PGM
ERROR)
ERROR:
ENDPGM
Control processing among procedures and programs and pass
parameters from a CL procedure to other procedures or
programs to override files.
PGMF) +