Interview Question and Answer – *CLP AS400 Control Language

Twenty years ago these are the kind of things you had to know to work on the old AS400 systems. I found these on an old dusty corner of my homeserver. Enjoy the trip down memory lane or to use old RPG lingo AS400NERD CABEQ ‘1’  START

CONTROL LANGUAGE (CL/400)

How to start a CL program ?
PGM.

How many files can be declared in CL ?
One.

Which precedes, the file declaration or variable declaration ?
Variable declaration and then File declaration.

What are the different types of variables available in CL ?
DEC, CHAR, LGL

In CL Program ‘&’ precedes ____ .
Variables.

How do you pass parameters in CL ?
Using PARM keyword.

Can libraries be added to the library list through CL ?
Yes, using ADDLIBL.

What is the difference between CAT, TCAT and BCAT ?
CAT : Concatenate two variables or constants into one continuous string.
BCAT : Truncates all trailing blanks in the first character string ; one blank is inserted , then the two character strings are concatenated.
TCAT : Truncates all trailing blanks in the first character string, thetwo character strings are concatenated.

How do you end a CL program ?
ENDPGM

What are the different types of messages in CL ?
Immediate message, Break message, Program message, User message.

How can errors be trapped in a CL program?
By using Monitor Message Command ( MONMSG )

What is the maximum length of a variable name in CL ?
Maximum 11 characters (including ‘&’)

What are the limitations of CL (compare to RPG) ?
You cannot use CL program to :
. ADD or UPDATE records in database files
. Use Printer or ICF files
. Use Program described files
. Use the concept of subfile (to display more than one record), but a single output message subfile is a special type of subfile that is supported well in CL
. Use subroutines.

You cannot declare more than one object (file) in a CL program.