Ü  CL source program segments

Ø  Although each source statement that is entered as part of a CL source program is actually a CL command, the source can be divided into the basic parts that are used in many typical CL source programs.

 

·         PGM command

PGM PARM (&A)

 

PGM is an Optional part for the beginning of the CL program. But it becomes mandatory if we need to pass parameter to the CL program.

 

 

·         Declare commands

(DCL, DCLF, COPYRIGHT)

 

This is used to declare the variables, files used in the program.

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

 

 

·         INCLUDE command

 

CL command to embed additional CL source commands at compile time

 

 

·         CL processing commands

CHGVAR, SNDPGMMSG, OVRDBF, DLTF …..

 

CL commands used to process the files, variables used in the program.

 

 

·         Logic control commands

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

 

Commands used to control processing within the CL program or procedure.

 

 

·         Built-in functions

%SUBSTRING (%SST), %BINARY (%BIN), %ADDRESS (%ADDR), %CAT()

 

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

 

 

·         Program control commands

CALL, RETURN, TFRCTL

 

CL commands used to pass control to other programs.

 

 

·         Procedure control commands

CALLPRC

CL command to pass control to another procedure

 

 

·         ENDPGM command

ENDPGM

 

Optional, End Program command.

 










User Comments:



Subscribe

  Email:



Copyright © www.go4as400.com, 2013-2017. Copyright notice