COBOL and JCL Fundamentals

Test your knowledge of COBOL programming statements, data definitions, and JCL job control language used in mainframe environments.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following are syntactically correct? (1) 01 REC-1 PIC SX(4). (2) 01 REC-2 PIC S9(4). (3) 01 REC-1 PIC V99. (4) 01 REC-1 PIC P99. (5) 01 REC-1 PIC 9(4)S. (6) 01 REC 1 PIC X(4).

  1. 2, 3 and 6
  2. 3, 4 and 6
  3. 1, 2 and 3
  4. 2, 3 and 4
Question 2 True/False

COMPUTE A=B is a valid statement

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

Maximum number of INSTREAM procedures

  1. 10
  2. 15
  3. 20
  4. 25
Question 4 Multiple Choice (Single Answer)

5 generations of a GDG already exist. Refer 1st generation in the JCL

  1. GDG (-4)
  2. GDG (-3)
  3. GDG (-5)
  4. GDG (1)
Question 5 Multiple Choice (Multiple Answers)

The parameter used to specify whether job is to be held until further notice or for syntax checking

  1. HOLD
  2. TYPERUN
  3. TYPRUN
  4. SCAN
Question 6 Multiple Choice (Single Answer)

I have multiple jobs in a member. What happens if I submit it?

  1. Multiple jobs are submitted
  2. Job will abend
  3. Only one step gets executed
  4. Only first job will be submitted
Question 7 Multiple Choice (Multiple Answers)

Which of the following functions can DD statements perform?

  1. Tell the system which data set to access
  2. Request a printer to produce the job output
  3. Indicate where to store new data sets
  4. Initiate a new program
Question 8 Multiple Choice (Multiple Answers)

Which of the following are considerations for selecting programs that may be grouped together as a job?

  1. Programs must run sequentially
  2. Programs must be dependent on each other
  3. Programs must access the same databases
  4. Programs must have the same accounting information
Question 9 Multiple Choice (Multiple Answers)

Which one of the following is a valid job name?

  1. //TEST*1
  2. // JOB13
  3. //$ABCD
  4. //STEPSEVEN
Question 10 Multiple Choice (Multiple Answers)

What are the correct values for the DSN parameter of a temporary data set?

  1. &NAME&(TEMP)
  2. &&TEMP(NAME)
  3. &&NAME
  4. &NAME
Question 11 True/False

vsam means virtual storage acess method

  1. True
  2. False
Question 12 True/False

SET is also a valid AMS command.

  1. True
  2. False
Question 13 Multiple Choice (Multiple Answers)

Which of the following PIC definitions can be used in the declaration of a record of a sequential file that will be used as INPUT

  1. PIC X(9)
  2. PIC S9(4) COMP
  3. PIC Z(4)
  4. PIC 9(4)V99
  5. PIC 9(4).99
Question 14 Multiple Choice (Multiple Answers)

"Which tests are allowed with the following variable? 01 END-OF-FILE PIC X. 88 EOF VALUE 'N'."

  1. IF EOF THEN …
  2. IF EOF IS TRUE THEN ...
  3. IF END-OF-FILE = 'Y' THEN ...
  4. IF END-OF-FILE THEN ...
Question 15 Multiple Choice (Single Answer)

Which of the following COBOL EVALUATE statements in syntactically NOT correct?

  1. EVALUATE A <n> WHEN 0 DISPLAY 'A = 0' <n> WHEN 5 DISPLAY 'A = 5' <n> WHEN OTHER DISPLAY 'A IS NOT 0 NOR 5' <n> END-EVALUATE
  2. EVALUATE TRUE <n> WHEN A=0 DISPLAY 'A = 0' <n> WHEN A=5 DISPLAY 'A = 5' <n> WHEN OTHER DISPLAY 'A IS NOT 0 OR 5' <n> END-EVALUATE
  3. EVALUATE A <n> WHEN A=0 DISPLAY 'A = 0' <n> WHEN A=5 DISPLAY 'A = 5' <n> WHEN OTHER DISPLAY 'A IS NOT 0 NOR 5' <n> END-EVALUATE
  4. none
Question 16 Multiple Choice (Single Answer)

Take a look at the following COBOL instruction. When will instruction-3 be executed? IF A=B THEN instruction-1 ELSE instruction-2. instruction-3.

  1. never
  2. if A is equal to B
  3. if A is different from B
  4. always
Question 17 Multiple Choice (Multiple Answers)

Which of the following statements concerning files are true?

  1. the FD entry in the DATA DIVISION gives a description of the structure of a file.
  2. the first record is automatically read on opening a file.
  3. if a file is opened in I-O mode you can use this file for reading as well as for writing.
  4. you can not read indexed files from a COBOL program.
  5. in the SELECT clause you have to give a complete description of the exact location of the file.
Question 18 Multiple Choice (Single Answer)

What is the content of RESULT after execution of the following COBOL instruction. The start value of RESULT is 0. PERFORM VARYING C FROM 1 BY 1 UNTIL C = 6 COMPUTE RESULT = RESULT + 1 END-PERFORM

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

Can a SEARCH be applied to a table which does not have an INDEX defined?

  1. No
  2. Yes
  3. can't say
  4. none
Question 20 Multiple Choice (Single Answer)

What is the maximum length of a field you can define using COMP-3?

  1. 8 Bytes
  2. 10 Bytes
  3. 12 Bytes
  4. 16 Bytes