Mainframe COBOL and JCL Programming
Test your knowledge of mainframe programming concepts including COBOL language features, JCL job control, and mainframe abend codes.
Questions
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.
- It is correct.
- It is not correct because first-name and middle name contain the same PIC Clauses
- Not correct because the PIC Clause is missing for the first three data items.
- Not correct because the level number 03 is missing
Determine the size of the data item S9(4). 99
- 6
- 7
- 8
- 4
To describe a record the level numbers may be chosen from
- 01 to 77
- 01 to 49 and 77
- all odd numbers from 01 to 49
- 01 to 49
What is the difference between comp and comp-3 usage.
- Comp is binary usage, while comp-3 indicates packed decimal.
- Comp is a packed decimal, while comp-3 indicates binary usage.
- Comp and Comp-3 are packed decimal.
- Comp and Comp-3 are binary usage.
What is file status 92?
- File is opened for input and an attempt is made To write to it (or Logic error).
- Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgn and the JCL ( or the dataset label).
- Attempted to open a file that is already open.
- File not found.
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?
- Condition 1 And Condition 2
- Condition 2 And Condition 1
- None of the above
- Does not depend on the order.
What is the file status for File not found.
- 4
- 6
- 13
- 35
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
- 12
- 1
- 2
- 121
How is sign stored in a COMP field?
- In the least significant bit. Bit is ON if -ve, OFF if +ve.
- In the most significant bit. Bit is ON if -ve, OFF if +ve.
- In the least significant bit. Bit is ON if +ve, OFF if -ve.
- In the most significant bit. Bit is ON if +ve, OFF if -ve.
What can be the possible cause for SOC-7 error?
- An un-initialized numeric item.
- Data exception(data items have invalid data).
- None of the above
- Both 1 and 2 are correct
How many bytes will a S9(8) COMP field occupy?
- 2
- 4
- 8
- 16
What is a scope terminator?
- Scope terminator is used to mark the end of a verb
- Scope terminator is used to mark the end of a statement
- Both 1 and 2
- None of the above
How many subscripts or indexes are allowed for an OCCURS clause?
- 4
- 5
- 6
- 7
What are the minimum requirements to compile a program without errors?
- Identification Division. Program-ID. Program-name.
- Identification Division. Program-ID. Program-name. Environment Division.
- Identification Division. Program-ID. Program-name. Environment Division. Data Division.
- Identification Division. Program-ID. Program-name. Environment Division. Data Division. Procedure Division.
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.
- 22
- 16
- 12
- 14
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?
- a & c
- b & d
- a, c, d
- a only
Dispositional parameters for DISP=( , , ) ?
- (NEW,DELETE,DELETE)
- (NEW,CATLG,DELETE)
- (NEW,CATLG,UNCATLG)
- (MOD,CATLG,DELETE)
How JCL steps can be skipped?
- IF THEN/ELSE
- COND
- BOTH
- Steps cannot be skipped in JCL.
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
- a & b only
- b & c only
- a, b, c only
- d only
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.
- a, b, & c
- a only
- a & b only
- b only