COBOL and JCL Mainframe Programming

Test your knowledge of COBOL programming syntax and JCL job control language concepts for IBM mainframe systems.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

If a field is defined as Pic s9(6)v99 comp-3, it uses 5 bytes of storage

  1. True
  2. False
  3. Cannot Say
  4. None
Question 2 Multiple Choice (Single Answer)

You store it as YYYYMMDD in 8 bytes. What is the COBOL definition of this field?

  1. Pic Y(4)M(2)D(2)
  2. Pic date(yyyymmdd)
  3. Pic date(8)
  4. Pic X(8)
Question 3 Multiple Choice (Single Answer)

"Let A = 0, B = 9….. Perform until a > b Add 2 to a End-perform How many additions are performed? "

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

What is S322 abend ?

  1. Time out abend
  2. Dataset out of space
  3. Caused by invalid data in a numeric field
  4. Storage Violation error
Question 5 Multiple Choice (Single Answer)

//MYJOB JOB(E343),'ABCDEFGH' //JOBLIB DD DSN=ABCD.PROD.LOADLIB,DISP=SHR //STEP1 EXEC PGM=PROG //STEPLIB DD DSN=ABCD.PPROD.LOADLIB,DISP=SHR //STEP2 EXEC PGM=PROG1 //STEPLIB DD DSN=ABCD.TEST.LOADLIB,DISP=SHR ..... ..... In the above code, from which library the loadmodule of PROG1 is executed

  1. ABCD.PROD.LOADLIB
  2. ABCD.PPROD.LOADLIB
  3. ABCD.TEST.LOADLIB
  4. none
Question 6 Multiple Choice (Single Answer)

"//STEP1 EXEC PGM=PROG,PARM='ABCDEFGH' Maximum number of characters that can be accomodated in parameter PARM"

  1. 64
  2. 128
  3. 100
  4. 125
Question 7 Multiple Choice (Multiple Answers)

Which is true?

  1. JOB REGION will override EXEC REGION
  2. EXEC COND will override JOB COND
  3. STEPLIB will override JOBLIB
  4. EXEC TIME will override JOB TIME
Question 8 Multiple Choice (Single Answer)

If REGION is coded as 0K or 0M, how much storage would be assigned to the job

  1. default storage; 255M
  2. All available storage
  3. will result in JCL error
  4. none
Question 9 Multiple Choice (Single Answer)

Coding TIME=MAXIMUM allows the job or step to run for

  1. 288 days
  2. 225 days
  3. 248 days
  4. 268 days
Question 10 Multiple Choice (Single Answer)

When we specify V for RECFM parameter, what should we mention for the value of LRECL parameter

  1. Largest record size in the file
  2. Average record size in the file
  3. Largest record size in the file plus 4 bytes
  4. Largest record size in the file plus 2 bytes
Question 11 Multiple Choice (Single Answer)

Maximum number of sequential datasets that can be concatenated

  1. 16
  2. 255
  3. 269
  4. 125
Question 12 Multiple Choice (Single Answer)

What statement marks the end of an in-stream or Catalogued procedure

  1. STREAM
  2. SET
  3. END-PROC
  4. PEND
Question 13 Multiple Choice (Single Answer)

A data set name can be up to ____ characters long, including periods.

  1. 41
  2. 45
  3. 46
  4. 44
Question 14 Multiple Choice (Single Answer)

COBOL statements should start in a fresh line

  1. True
  2. False
  3. can't say
  4. none
Question 15 Multiple Choice (Single Answer)

which code snippet can be used to iterate an instruction for 6 times? Note: indicates new line

  1. REPEAT 6 TIMES <n> instruction <n> END-REPEAT
  2. MOVE 1 TO COUNTER <n> PERFORM UNTIL COUNTER = 6 <n> COMPUTE COUNTER = COUNTER + 1 <n> instruction <n> END-PERFORM
  3. PERFORM 6 TIMES <n> instruction <n> END-PERFORM
  4. REPEAT VARYING COUNTER FROM 1 BY 1 UNTIL COUNTER = 6 <n> instruction <n> END-PERFORM
Question 16 Multiple Choice (Multiple Answers)

Which of the following variable names for data items are not syntactically correct?

  1. CIBER-CITY
  2. -NW-OF-FOOD
  3. TOTAL-NO-OF-LINES-PER-PAGE
  4. PHONE NUMBER
  5. INDEX
Question 17 Multiple Choice (Multiple Answers)

A period is mandatory

  1. after each 01 level of a variable declaration
  2. at the end of each instruction
  3. at the end of each paragraph
  4. at the end of the program
  5. to end an IF instruction
Question 18 Multiple Choice (Multiple Answers)

which character can not be coded at column 7 in a program

  1. -
  2. *
  3. /
  4. #
Question 19 Multiple Choice (Single Answer)

Say A, B, C, ... are COBOL statements, in which order will they be executed? MAIN-PAR. PERFORM INIT-PAR Z PERFORM TERM-PAR X STOP RUN. INIT-PAR. A B PERFORM READ-X. LOOP-PAR. E F. TERM-PAR. G H. READ-X. X.

  1. A B Z E F Z X
  2. A B X Z E F G H Z X
  3. A B X Z G H X
  4. A B X Z G H Z
Question 20 Multiple Choice (Single Answer)

Take a look at the following variable declarations. What will be the content of RESULT at the end of the series of MOVE instructions? 01 ELE-1 PIC X(5) VALUE 'ELRI'. 01 ELE-2 PIC X(10). 01 ELE-3 PIC X(2). 01 RES PIC X(5). MOVE 'TABLE' TO RES MOVE ELE-1 TO ELE-2 MOVE ELE-2 TO ELE-3 MOVE ELE-3 TO RES

  1. ELbbb (bbb = 3 blancs)
  2. TABLE
  3. TABEL
  4. ELBLE