Mainframe Multiple Choice Questions

Hello friends in this post we are going to discuss about Mainframe Multiple Choice Questions| Mainframe Objective Type Questions| Mainframe MCQ with Answers| Mainframe Accenture Practice Test

Q1. Below is the COBOL declaration of Employee details PS dataset. If the Employee dataset already has three employee records, what will be the output on execution of below code snippet?

ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION FILE-CONTROL relateSELECT EMPFILE ASSIGN TO EMP ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS WS-FS1.DATA DIVISION.FILE SECTION FD EMPFILE.01 FS-EMPRECPIC 9(4)PIC A(10) PIC A(10)05 FS-EMPNAME 05 FS-EMPLOC PROGEDURE DIVISON05 FS-EMPNO

A. A new employee record will be added after the three records in the Employee dataset.

B. A new employee record will be added after deleting the old three records.

C.Write operation cannot be performed in the OUTPUT mode.

D.Compilation error due to invalid WRITE syntax. It must be WRITE EMPFILE.

Ans: b

Q2. Consider the following code snippet. Note: Empfile is a PS file has 5 records.

01 WS-EOF PIC X(1) value ‘Y’
MAIN-PARA..
PERFORM OPEN-PARA.
PERFORM READ-PARA UNTIL WS-EOF= ‘Y PERFORM CLOSE-PARA
READ-PARA.
READ EMPFILE
AT END MOVE ‘Y TO WS-EOF
NOT AT END DISPLA FS-EMPREC
END-READ.

A. All 5 records will be displayed in Spool
B. First 4 records will be displayed in Spool
C . No records will be displayed in spool
D. Only 1st record will be displayed in spool

Ans: c

Q3. DATA DIVISION.FILE SECTION.FD CFILE.01 FS-CREC05 FS-CNO PIC 9(5)05 FS-CNAME PIC A(15)05 FS-CADD PIC X(15)01 WS-FS1 PIC 99PROCEDURE DIVISION.MAIN-PARAOPEN INPUT CFILEPERFORM 1000-READ-PARA UNTIL WS-FS1= 10CLOSE CFILE. STOP RUN.4000-READ-PARA.READ CFILE.EVALUATE WS-FS1WHEN 00IF FS-CADD = INDIADISPLAY FS-CRECEND-IF

Ans –

10001RAM INDIA
10003DEEPTHI INDIA
10005PRIYANKA INDIA
END OF FILE

Q4. Identify the incorrect lines of below code:100 IDENTIFICATION DIVISION 200 PROGRAM-ID. MOVE. 300 ENVIRONMENT DIVISION. 400 INPUT-OUTPUT SECTION. 500 FILE SECTION.

Ans – 200&500

Q5. Choose a correct definition in file control para to read the data randomly from KSDS dataset?

Ans – SELECT CFILE ASSIGN TO DD1 ORGANIZATION IS INDEXED ACCESS MODE IS RANDOM RECORD KEY IS FS-CNO-KEY.

Q6. Identify the right statements from the given below about KSDS.

A.KSDS supports only RANDOM and DYNAMIC access mode

B. Access mode RANDOM doesnot support START command

C. KSDS record key can be updated

D. Opening mode for DELETE is 1-O

E. Record key is not a mandatory statement in file control para of KSDS

Ans: B D

Q7. Consider the below COBOL code snippet. Assume there are no syntax errors.DATA DIVISION.WORKING-STORAGE SECTION 01 EMPLOYEE-TABLE.02 EMPLOYEE-DATA OCCURS 100 TIMES.03 EMPLOYEE-ID PIC 9(5)03 EMPLOYEE-NAME PIC X(25)03 EMPLOYEE-LOCATION PIC accarial X(20)b)How do you access all the details of employ occuring at index 50?a)What is the size of EMPLOYEE-TABLE?

A. a) 5000 bytes
b) EMPLOYEE-DATA(49)
B.a) 5000 bytes
b) EMPLOYEE-DATA(50)
C.a) 50 bytes
b) EMPLOYEE-DATA(50)
D.a) 50 bytes
b) EMPLOYEE-DATA(49).

Ans: c

Q8. What happens when EXTEND mode is used to open the PS file for execution of some record processing?

A.The new records are appended to the existing file
B.The records existing in file are replaced with new records
C.The records existing in file are compared with new records.Non-unique records are added.
D. The records existing in file are deleted and new records are inserted

Ans: a

Q9. Identify the appropriate opening mode for the Indexed file(KSDS) that supports all file I/O operations(READ/WRITE/DELETE/START/REWRITE).

A. INPUT

B. I-O

C.EXTEND

D.OUTPUT

Ans: b

Q10. Geetha who is a new joiner in ABC Banking project is assigned a task to work on variable length file(TFILE). The following is the record structure of the VB file.
01 T-NEW-CREC
05 TRANS-TYPE-N PIC 9(1)
05 TNCID PIC 9(4)
05 TNNAME PIC X(15)
05 TNADD PIC X(20) .
05 TNDOB PIC X(10)
05 TNMOBILE PIC 9(10)
01 T-DEL-REC.
05 TRANS-TYPE-D PIC 9(1).
05 TDCID PIC 9(4).
Can you help Geetha in coding the correct FD statement for the VB file in the Cobol program?

A. FD TFILE

RECORD IS VARYING IN SIZE FROM 4 TO 64 CHARACTERS.

B. FD TFILE

RECORD IS VARYING IN SIZE FROM 5 TO 70 CHARACTERS.

C.FD TFILE

RECORD IS VARYING IN SIZE FROM 5 TO 74 CHARACTERS.

D.FD TFILE

RECORD IS VARYING IN SIZE FROM 5 TO 60 CHARACTERS.

Ans: d

Q11. Identify the correct statement about binary SEARCH. Choose most appropriate option.

A. Table entries need not be in any sequence.

B. Multiple WHEN conditions can be used.

C.All relational (or compound) parameters are acceptable with the WHEN clause.

D. Table entries need to be in sequence by any field.

Ans: c

Q12. If you are using a KSDS file in your program, then in which of the following division and section do you declare the name of the file?

A. ENVIRONMENT DIVISION, INPUT-OUTPUT SECTION

B. PROCEDURE DIVISION,FILE SECTION

C. ENVIRONMENT DIVISION, FILE SECTION

D. DATA DIVISION,FILE SECTION

Ans: a

Q13. What is the cobol statement to be coded in sub program to return control to main program?

A. EXIT PROGRAM

B. RETURN

C. STOP PGM

D. STOP RUN

Ans: a

Q14. The Procedure Division entry for the called program includes the following clause.

A.USING

B.USAGE

C.GIVING

D.OCCURS

Ans: a

Q15. REO is coding a Cobol program to read data from PS file IDC001 FILE1 Choose the name of statement is used to map logical file name in program and actual file name in RUNJCL?

A. ORGANIZATION statement

B. FILE STATUS statement

C. SELECT statement

D. ACCESS MODE statement

Ans: c

Q16. How do you access the second customer’s name from the below Cobol Table using subscript?
01 WS-CUST-RECORD
05 WS-CUST-TABLE OCCURS 3 TIMES.
10 WS-CUSTID PIC 9(5)
10 WS-CUSTNAME PIC A(10)

A. WS-CUST-TABLE(2)

B. WS-CUST-TABLE(1)

C. WS-CUSTNAME(1)

D. WS-CUSTNAME(2)

Ans: d

Q17. Amy has coded below code to open the logical file named EMPFILE without mentioning the opening mode. OPEN EMPFILE

A. INPUT

B. No default mode assumed by Cobol. Amy has to explicitly mention the opening mode

C. EXTEND

D. I O

Ans: b

Q18. Jack is creating a Cobol program to read last 10 records of KSDS file. The KSDS file has 20 records Help Jack to choose the correct file operations and steps to perform above operation.

A. Execute the READ in loop

B. Execute the START command and then execute READ NEXT RECORD in loop

C. Execute the START command and then execute READ in loop

D. Execute the START command in loop

Ans: c

Q19. Mary is trying to read only one record using primary key from KSDS. In this scenario, what is appropriate access mode she should use?

A. ACCESS MODE IS SEQUENTIAL

B. ACCESS MODE IS RANDOM

C.ACCESS MODE IS ONLY

D. ACCESS MODE IS DYNAMIC

Ans: b

Q20. Which file operation does not support by sequential file (PS file) in Cobol?

Ans – Del, Start

Leave a comment