Now, Get RPG Codes in all three formats only on this website on every RPGLE related programming article.

Fixed, /Free and Fully Free RPG


Parts of a CL source program

Parts of a CL source program
Parts of a CL source program, CL,program,segments,PGM command,CL,Declare command,INCLUDE command,CL processing commands,Logic control commands,Program control commands,Procedure control commands,ENDPGM command,as400,ILE RPG, rpg,rpgle,control language,cl programming,Control
Parts of a CL source program

Each CL source statement is a CL command and these CL source commands can be divided into basic parts as follows. A CL program or procedure can refer to other objects that must exist when the program or procedure is created.

PGM command

This is an optional command used for begin the CL source program and identify any parameters received to CL programs.

PGM

or

PGM PARM(&A)

or

PGM PARM(&A &B)

Declare commands

The declare commands must precede all other commands except the PGM command.

DCL (Declare Variable) 
DCLF(Declare File)
COPYRIGHT
DCLPRCOPT

INCLUDE command

It is used to embed additional CL source commands at compile time.

Processing commands

It is used as source statements to manipulate constants or variables.

CHGVAR (Change Variable) 
OVRDBF (Override Database File)
etc

Logic control commands

It is used to control processing within the CL program or procedure.

IF
THEN
ELSE
DO 
ENDDO 
DOWHILE
DOUNTIL
DOFOR
LEAVE
ITERATE 
GOTO
SELECT
ENDSELECT
WHEN
OTHERWISE 
CALLSUBR
SUBR
RTNSUBR
ENDSUBR

Built-in functions

Built-in functions and operators are used in arithmetic, character string, relational or logical expressions.

%SUBSTRING (%SST)
%SWITCH
%BINARY (%BIN)
%ADDRESS (%ADDR)
%OFFSET (%OFS) 
%CHECK 
%CHECKR
%SCAN 
%TRIM 
%TRIML 
%TRIMR

Program control commands

It is used to pass control to other programs.

CALL
RETURN
TRFCTL

Procedure control commands

It is used to pass control to other procedures.

CALLPRC

ENPGM command

It is an optional End Program command.

ENDPGM

Related Post

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain