0

mainframe Online Quiz - 105

Description: mainframe Online Quiz - 105
Number of Questions: 20
Created by:
Tags: mainframe
Attempted 0/20 Correct 0 Score 0
  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


Correct Option: A
  1. 01 to 77

  2. 01 to 49 and 77

  3. all odd numbers from 01 to 49

  4. 01 to 49


Correct Option: D
  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.


Correct Option: A
Explanation:

To understand the difference between comp and comp-3 usage, the user needs to know about the different data types in COBOL programming language.

A) Comp is binary usage, while comp-3 indicates packed decimal. This option is incorrect because comp is not binary usage. Comp is a usage for binary integers and comp-3 is a usage for packed decimal.

B) Comp is a packed decimal, while comp-3 indicates binary usage. This option is incorrect because it incorrectly states the usages of comp and comp-3. Comp is a usage for binary integers, while comp-3 is a usage for packed decimal.

C) Comp and Comp-3 are packed decimal. This option is incorrect because comp and comp-3 are not both packed decimal. Comp is a usage for binary integers, while comp-3 is a usage for packed decimal.

D) Comp and Comp-3 are binary usage. This option is incorrect because comp and comp-3 are not both binary usage. Comp is a usage for binary integers, while comp-3 is a usage for packed decimal.

The Answer is: A. Comp is binary usage, while comp-3 indicates packed decimal.

  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.


Correct Option: A

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.


Correct Option: B

What is the file status for File not found.

  1. 4

  2. 6

  3. 13

  4. 35


Correct Option: C

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


Correct Option: B

AI Explanation

To answer this question, we need to understand the concept of REDEFINES in COBOL.

In COBOL, the REDEFINES clause is used to define two or more data items that occupy the same storage location. Essentially, it allows you to define different data items that share the same memory space.

In this case, we have two data items:

  1. WS-TOP: This is defined as a single character element.
  2. WS-TOP-RED: This is defined as a redefinition of WS-TOP, but with a length of 2 characters.

When you MOVE "12" to WS-TOP-RED, it means that you are assigning the value "12" to the memory space occupied by WS-TOP-RED. Since WS-TOP-RED redefines WS-TOP, both data items share the same memory space.

Now, when you DISPLAY WS-TOP, it will show the value stored in the memory space occupied by WS-TOP. Since "12" was moved to WS-TOP-RED, which redefines WS-TOP, the value displayed will be the first character of the moved value, which is "1".

Therefore, the correct answer is B) 1.

  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.


Correct Option: B
  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


Correct Option: D

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


Correct Option: C
  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.


Correct Option: A

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


Correct Option: B

Dispositional parameters for DISP=( , , ) ?

  1. (NEW,DELETE,DELETE)

  2. (NEW,CATLG,DELETE)

  3. (NEW,CATLG,UNCATLG)

  4. (MOD,CATLG,DELETE)


Correct Option: A
  1. IF THEN/ELSE

  2. COND

  3. BOTH

  4. Steps cannot be skipped in JCL.


Correct Option: C

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


Correct Option: C
- Hide questions