Tuesday, August 8, 2017

TEST ON CL Programming 1




                                                                                                                                                                 Total Time: 1 hr
                                                                                                                                                                Tot. Marks: 50

Tick one or more correct choice/s  (1 Mark each)                                            


1.                   Which of the following is not a valid CL datatype?

(a)     *dec
(b)    *char
(c)     *log
(d)    *lgl

2.             Max no. of files that can be declared in a CL program
(a)     0
(b)    1
(c)     50
(d)    9999

3.             How many files can be updated through CL
(a)     0
(b)    1
(c)     20
(d)    50

4.             Predict which programs will be executed in the following code when  &Opt = ‘1’:
IF COND(&Opt *EQ ‘1’)
                                THEN ( Call Pgm4)
ELSE
                                CMD(Call Pgm3)
                                CALL Pgm(Pgm2)
CALL Pgm(Pgm1)

5.             Which of the following files can be used in the TOFILE parameter of CPYF?                     
a)      Logical file
b)      Join Logical file
c)      Tape file
d)      None of the above

6.             Which of the following commands cannot be used on the command line?                                            
a)      RTVDTAARA
b)      CRTDTAARA
c)      CHGDTAARA
d)      All the above

7.             What is the command used to find all logical files based on one physical file?                     
a)      DSPDBR
b)      DSPOBJD
c)      DSPPFM
d)      a and b

8.             Which is the command used to find the access path of a file?                                                   
a)      DSPFFD
b)      DSPFD
c)      DSPOBJD
d)      All the above

9.             Which of the following combination of files can be declared in CLP?                                    
a)      Printer file, Database file
b)      Display subfile, Message subfile
c)      Message subfile, Database file
d)      Database file, Display subfile

10.          What is the function of DSPPGMREF?                                                                                                          
a)      Displays list of all files referred in the program
b)      Displays the list of all objects used in the program
c)      Displays all copy books used in the program
d)      Displays list of all call programs used in the program



Use Short Answers: (2 Marks each)

1.                   What is the difference between program level and command level MONMSG?



2.                   What is the difference between TFRCTL command and CALL command?



3.                   How can the data be shared across different jobs?



4.                   Differentiate between data base files and data areas



5.                   How do you compile RPG program having compile time override?



6.             What is wrong in the following program:
PGM
MONMSG CPF0000
DCLF FILE (INPUT)
ENDPGM



7.             How do you know the keys used in a physical file without using SEU?



8.              How to extract a word “hello” from the string “hello world”?



9.              Which has the highest priority if you give both program level MONMSG and command level        MONMSG?

10.           How to use  multiple files in CLP?



Mention True/False: (1 Mark each)

1.             Two objects with same name and type cannot exist in different libraries

2.             The built-in menu called MAJOR organizes all the AS/400 commands

3.             SNDF writes a record to a display or a data base file.

4.             The value of a CL variable can be changed using CHGVAR

5.             The current library cannot be a duplicate of any library in the library list

6.             The RETURN command in a program removes that program from the program stack

7.             A data area is an object used to hold data for access by any job running on the system.

8.             Library list is an object

9.             LDA can be used to pass information to a subprogram without the use of a parameter list

10.          SNDPGMMSG command allows us to send messages to a work station user or the system operator.



Answer the following questions: (2 marks each)

1.             Not all CL commands can be used in a CL program (TRUE/FALSE)

2.                   Declare commands must precede all other commands except the PGM command. (TRUE/FALSE)

3.             ENDPGM command is a mandatory command in a CL program. (TRUE/FALSE)

4.             ____________________________ Monitors for escape, status, and notify messages sent to a program's message queue

5.             __________________ identifies a command in a CL program and is used for branching purposes



OS400/CL400 Exam 1



1.       In the same library there can be objects of the same name of different object types. This statement is
a)       True
b)       False
c)       None of the above

2.       Types of jobs on OS/400 are
a)       2
b)       3
c)       4
d)       5

3.        Save file is an object and it is used for the backup. This statement is 
a)       True
b)       False
c)       None of the above

4.       In join logical file you can have multiple files and multiple record formats. This statement is 
a)       True
b)       False
c)       None of the above

5.       To show the physical file member , its attribute and its logical files commands used is 
a)       DSPDBR
b)       DSPFFD
c)       DSPFD
d)       DSPPFM

6.       To look at the job correct ser of command used is
a)       WRKACTJON, WRKSBMJOB,DSPJOB,WRKUSRJOB 
b)       WRKSBMJON,WRKSBSJOB,WRKUSRJOB 
c)       WRKACTJOB,WRKSBSJOB,DSPJOB,WRKUSRJOB

7.        DYNSLT keyword is used in
a)       Physical file
b)       Logical file
c)       Both
d)       None of the above

8.        Command function and command attention Key performs the same function and have same concept. . This statement is 
a)       True
b)       False
c)       None of the above


9.       OPNQRY FILE AND LOGICAL FILE both are used to access the database file only. This statement is 
a)       True
b)       False
c)       None of the above

10.    Which statement is false
a)       QUERY400, OPNQRYF, LOGICAL FILE all are objects.
b)       Logical file is an object
c)       QUERY400 is a system supplied  utility
d)       OPNQRY is not an object

11.    There are 2 physical files. File(a) is having 3 logical file and other File(b) is having 2 logical file. Which can be easily complied with out deleting its dependent logical file 
a)       File(a)
b)       File(b)
c)       None of the above

12.    In join Logical File Min. files required are
a)       1
b)       6
c)       32
d)       None of the above

13.     In join logical file Max files required are
a)       2
b)       4
c)       6
d)       32

14.    To find a string CL command used is
a)       FNDSTRPDM
b)       ALCOBJ
c)       DSPFD
d)       None of the above

15.    Please read the following CL statements

 Program A 
CALL PGM (B) 
OPEN FILE X 
OPEN FILE A

Program B
OVRDBF FILE (X) FILE (Y)
OVRDBF FILE (A) TOFILE (B) OVERSCOPE (*JOB)
RETURN

The file opened in the program A is 
a)       File A,X
b)       File B.Y
c)       File X,B  
d)       File Y,A


16.    Please read the following CL statements.
 Program A
OVRDBF FILE(B) TOFILE(C)
OVRDBF FILE(A) TOFILE(B)

OPEN FILEA.
File opened will be
a)       A.
b)       B 
c)       C
d)       None of the above

17.    Read the following statements

Program A 
OVRDKTF FILE(A) ToFILE(B) 
ENDPGM 

Program B
OPEN FILEA 
File Opened will be
a)       A.
b)       B 
c)       None of the above

18.    You can send a message in the program through subfile. . This statement is 
a)       True
b)       False
c)       None of the above

19.    QCMDEXC is a system supplied API. This statement is 
a)       True
b)       False
c)       None of the above

20.    You can display a error message only on 24th Line in a display file. . This statement is 
a)       True
b)       False
c)       None of the above

21.    You can define (a) Only one file in CL program .(b) & update the database  file through CL program .In this statement 
a)       A is true B is false
b)       B is true A is false
c)       A & B are true
d)       A & B are false

22.    You can get the user information in the CL program by using command
a)       RTVJOBA
b)       RTVUSRPRF
c)       DSPJOBA
d)       RTVSYSVAL 
e)       None of the above

23.    (A ) call in the CL program will pass control to the next program. (B) while RETURN command remove the procedure from the call stack .In This statement
a)       A is true B is false
b)       B is true A is false
c)       A & B are true
d)       A & B are false

24.    (A) Call in the CL program will pass control to the next program and again back to the calling program.(B) while TFRCTL command removes the calling program from the call stack. In this statement
a)       A is true B is false
b)       B is true A is false
c)       A & B are true
d)       A & B are false

25.    Wait command is used in CL program only. This statement is 
a)       True
b)       False
c)       None of the above