COBOL and JCL Mainframe Programming
Test your knowledge of COBOL programming syntax and JCL job control language concepts for IBM mainframe systems.
Questions
If a field is defined as Pic s9(6)v99 comp-3, it uses 5 bytes of storage
- True
- False
- Cannot Say
- None
You store it as YYYYMMDD in 8 bytes. What is the COBOL definition of this field?
- Pic Y(4)M(2)D(2)
- Pic date(yyyymmdd)
- Pic date(8)
- Pic X(8)
"Let A = 0, B = 9….. Perform until a > b Add 2 to a End-perform How many additions are performed? "
- 3
- 4
- 5
- 6
What is S322 abend ?
- Time out abend
- Dataset out of space
- Caused by invalid data in a numeric field
- Storage Violation error
//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
- ABCD.PROD.LOADLIB
- ABCD.PPROD.LOADLIB
- ABCD.TEST.LOADLIB
- none
"//STEP1 EXEC PGM=PROG,PARM='ABCDEFGH' Maximum number of characters that can be accomodated in parameter PARM"
- 64
- 128
- 100
- 125
Which is true?
- JOB REGION will override EXEC REGION
- EXEC COND will override JOB COND
- STEPLIB will override JOBLIB
- EXEC TIME will override JOB TIME
If REGION is coded as 0K or 0M, how much storage would be assigned to the job
- default storage; 255M
- All available storage
- will result in JCL error
- none
Coding TIME=MAXIMUM allows the job or step to run for
- 288 days
- 225 days
- 248 days
- 268 days
When we specify V for RECFM parameter, what should we mention for the value of LRECL parameter
- Largest record size in the file
- Average record size in the file
- Largest record size in the file plus 4 bytes
- Largest record size in the file plus 2 bytes
Maximum number of sequential datasets that can be concatenated
- 16
- 255
- 269
- 125
What statement marks the end of an in-stream or Catalogued procedure
- STREAM
- SET
- END-PROC
- PEND
A data set name can be up to ____ characters long, including periods.
- 41
- 45
- 46
- 44
COBOL statements should start in a fresh line
- True
- False
- can't say
- none
which code snippet can be used to iterate an instruction for 6 times? Note: indicates new line
- REPEAT 6 TIMES <n> instruction <n> END-REPEAT
- MOVE 1 TO COUNTER <n> PERFORM UNTIL COUNTER = 6 <n> COMPUTE COUNTER = COUNTER + 1 <n> instruction <n> END-PERFORM
- PERFORM 6 TIMES <n> instruction <n> END-PERFORM
- REPEAT VARYING COUNTER FROM 1 BY 1 UNTIL COUNTER = 6 <n> instruction <n> END-PERFORM
Which of the following variable names for data items are not syntactically correct?
- CIBER-CITY
- -NW-OF-FOOD
- TOTAL-NO-OF-LINES-PER-PAGE
- PHONE NUMBER
- INDEX
A period is mandatory
- after each 01 level of a variable declaration
- at the end of each instruction
- at the end of each paragraph
- at the end of the program
- to end an IF instruction
which character can not be coded at column 7 in a program
- -
- *
- /
- #
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.
- A B Z E F Z X
- A B X Z E F G H Z X
- A B X Z G H X
- A B X Z G H Z
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
- ELbbb (bbb = 3 blancs)
- TABLE
- TABEL
- ELBLE