AS400 Control Language (CL) Interview questions

In this blog post, we will see what are the major CL commands used in IBM iSeries/AS400. And what are the CL command questions asked during an interview? Let's see one by one below.
1) Limitations/Drawbacks in CL
     Ans:
  • Add or Update records in the database file
  •  Can't use printer or ICF file
  •  Can't use program described files
  •  Doesn't support subfile (to display more than one record) and subroutine
  • Can't declare more than one object(file)
2) Which CL command is used to read a file?
     Ans: RCVF - Receive File

3) What is the use of the CPYF command?
     Ans: CPYF - Copy File
    Copies the data from one file to another file

4) How can we send messages from CL program?
     Ans: SNDPGMMSG - Send Program Message

5) How can we pass parameters in CL?

     Ans: PARM keyword used to pass parameter.

6) What is a subsystem?

     Ans: A subsystem is a specialized environment used for the execution of a job.

7) Which command is used to see all the objects and it's sizes in a library?

     Ans: DSPLIB - Display Library
    This command gives the details of all objects that present in a library with their size.

8) How can we trap/handle errors in CL?

     Ans: By using Monitor Message (MONMSG) command.

9) Can we add a record or update a record in a physical file through CL?

     Ans: No. CL doesn't support add or updating physical files. Only perform read operation.

10) How many parameters can be passed through CL?

       Ans: Maximum number of parameters passed is 40 in CL

11) Which command is used to access the query?

       Ans: WRKQRY - Work with Queries

12) What is the maximum length of a variable name in a CL program?

       Ans: 11 (including '&')

13) What is the commonly used command for debugging?

       Ans: STRDBG (used for batch jobs)

14) List the different types of messages in CL.

       Ans:
  • Immediate message
  • Break message
  • Program message
  • User message
15) How can we add a field to a physical file already containing data?
       Ans: Using CPYF command with options as *NOCHK and *DROP

16) How will RUNQRY show the output?
       Ans: RUNQRY always shows the output in RRN (Relative Record Number) not in keyed sequence.

17) What is the use of the CPYSPLF command?
       Ans: Copies spooled file to a database file.

18) How can you create a replica of an original object using the CL command?

       Ans: CRTDUPOBJ - Create Duplicate Object

19) List the data types available in CL.

       Ans:
  • CHAR
  • DEC
  • LGL     
20) What is the use of the CHGVAR command?
       Ans: To change the value that presents inside a CL variable

No comments:

Post a Comment

You might also like

Deploy your Django web app to Azure Web App using App Service - F1 free plan

In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...