Mainframe COBOL and JCL Programming

Test your knowledge of mainframe programming concepts including COBOL language features, JCL job control, and mainframe abend codes.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

The following is Data Division entry 01 EMP-RECORD. 02 EMP-NAME. 04 FIRST-PART. 05 FIRST-NAME PIC X (10). 05 MIDDLE-NAME PIC X (10). 04 SURNAME PIC X(20). Which one of the following gives correct information about the above record description.

  1. It is correct.
  2. It is not correct because first-name and middle name contain the same PIC Clauses
  3. Not correct because the PIC Clause is missing for the first three data items.
  4. Not correct because the level number 03 is missing
Question 2 Multiple Choice (Single Answer)

Determine the size of the data item S9(4). 99

  1. 6
  2. 7
  3. 8
  4. 4
Question 3 Multiple Choice (Single Answer)

To describe a record the level numbers may be chosen from

  1. 01 to 77
  2. 01 to 49 and 77
  3. all odd numbers from 01 to 49
  4. 01 to 49
Question 4 Multiple Choice (Single Answer)

What is the difference between comp and comp-3 usage.

  1. Comp is binary usage, while comp-3 indicates packed decimal.
  2. Comp is a packed decimal, while comp-3 indicates binary usage.
  3. Comp and Comp-3 are packed decimal.
  4. Comp and Comp-3 are binary usage.
Question 5 Multiple Choice (Single Answer)

What is file status 92?

  1. File is opened for input and an attempt is made To write to it (or Logic error).
  2. Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgn and the JCL ( or the dataset label).
  3. Attempted to open a file that is already open.
  4. File not found.
Question 6 Multiple Choice (Single Answer)

Condition 1 AND Condition 2 Condition 1 is be true 80% of times and Condition 2 is true 20% of times. If both conditions are processed with IF command, then conditions should be coded in which order?

  1. Condition 1 And Condition 2
  2. Condition 2 And Condition 1
  3. None of the above
  4. Does not depend on the order.
Question 7 Multiple Choice (Single Answer)

What is the file status for File not found.

  1. 4
  2. 6
  3. 13
  4. 35
Question 8 Multiple Choice (Single Answer)

01 WS-TOP PIC X(1) 01 WS-TOP-RED REDEFINES WS-TOP PIC X(2). If you MOVE "12" to WS-TOP-RED, DISPLAY WS-TOP will show

  1. 12
  2. 1
  3. 2
  4. 121
Question 9 Multiple Choice (Single Answer)

How is sign stored in a COMP field?

  1. In the least significant bit. Bit is ON if -ve, OFF if +ve.
  2. In the most significant bit. Bit is ON if -ve, OFF if +ve.
  3. In the least significant bit. Bit is ON if +ve, OFF if -ve.
  4. In the most significant bit. Bit is ON if +ve, OFF if -ve.
Question 10 Multiple Choice (Single Answer)

What can be the possible cause for SOC-7 error?

  1. An un-initialized numeric item.
  2. Data exception(data items have invalid data).
  3. None of the above
  4. Both 1 and 2 are correct
Question 11 Multiple Choice (Single Answer)

How many bytes will a S9(8) COMP field occupy?

  1. 2
  2. 4
  3. 8
  4. 16
Question 12 Multiple Choice (Single Answer)

What is a scope terminator?

  1. Scope terminator is used to mark the end of a verb
  2. Scope terminator is used to mark the end of a statement
  3. Both 1 and 2
  4. None of the above
Question 13 Multiple Choice (Single Answer)

How many subscripts or indexes are allowed for an OCCURS clause?

  1. 4
  2. 5
  3. 6
  4. 7
Question 14 Multiple Choice (Single Answer)

What are the minimum requirements to compile a program without errors?

  1. Identification Division. Program-ID. Program-name.
  2. Identification Division. Program-ID. Program-name. Environment Division.
  3. Identification Division. Program-ID. Program-name. Environment Division. Data Division.
  4. Identification Division. Program-ID. Program-name. Environment Division. Data Division. Procedure Division.
Question 15 Multiple Choice (Single Answer)

Determine the total number of bytes in the following 01 REC-1. 02 FIRST-GROUP. 03 A1 PIC X(4). 03 A2 PIC 99. 02 REDEFINES FIRST-GROUP. 03 A3 PIC 999. 03 A4 PIC 999. 02 THIRD-GROUP. 03 A5 OCCURS 5 TIMES PIC 99.

  1. 22
  2. 16
  3. 12
  4. 14
Question 16 Multiple Choice (Single Answer)

Primary space allocated first and then if required Secondary space will be allocated. b. Secondary space allocated first and then if required Primary space will be allocated. c. Primary and Secondary space allocated at the time of Job starts execution. d. Primary and Secondary space allocated at the time of Step starts execution. Which statement(s) is TRUE?

  1. a & c
  2. b & d
  3. a, c, d
  4. a only
Question 17 Multiple Choice (Single Answer)

Dispositional parameters for DISP=( , , ) ?

  1. (NEW,DELETE,DELETE)
  2. (NEW,CATLG,DELETE)
  3. (NEW,CATLG,UNCATLG)
  4. (MOD,CATLG,DELETE)
Question 18 Multiple Choice (Single Answer)

How JCL steps can be skipped?

  1. IF THEN/ELSE
  2. COND
  3. BOTH
  4. Steps cannot be skipped in JCL.
Question 19 Multiple Choice (Single Answer)

Possible ways to rectify S322, a. Change the CLASS b. TIME=1440 c. Remove abnormal logic in the code(like infinite looping). d. Change PRTY

  1. a & b only
  2. b & c only
  3. a, b, c only
  4. d only
Question 20 Multiple Choice (Single Answer)

Possible causes for S0C4 a. Reading a file that is not open. b. Invalid address referred due to subscript error c. Tried moving variable length record that was larger than target field size.

  1. a, b, & c
  2. a only
  3. a & b only
  4. b only