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

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.

  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

Determine the size of the data item S9(4). 99

  1. 6

  2. 7

  3. 8

  4. 4


Correct Option: C

AI Explanation

To determine the size of the data item S9(4).99, we need to understand the format and meaning of the given data item.

In COBOL, the S9 format represents a signed numeric decimal value, where the S indicates that the number can be positive or negative, and the 9 indicates that it is a numeric digit.

The (4) following S9 indicates that the data item can have a maximum of 4 digits.

The .99 represents the number of decimal places that the data item can have. In this case, it can have two decimal places.

To calculate the size of the data item, we need to consider the following:

  • Each digit requires one byte of storage.
  • The sign, if present, requires one byte of storage.
  • The decimal point, if present, does not require any additional storage.

So, the size of the data item S9(4).99 can be calculated as follows:

4 (digits) + 1 (sign) + 2 (decimal places) = 7

Therefore, the correct answer is option B) 7.

To describe a record the level numbers may be chosen from

  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

AI Explanation

To describe a record in programming, level numbers are used. The level numbers indicate the hierarchy or structure of the data in a record. Each level number represents a specific level of the record's structure.

In COBOL programming, the level numbers typically range from 01 to 49.

Option A) 01 to 77 - This option is incorrect because the level numbers in COBOL do not go up to 77. The highest level number is 49.

Option B) 01 to 49 and 77 - This option is incorrect because the level number 77 is not part of the range of valid level numbers in COBOL.

Option C) all odd numbers from 01 to 49 - This option is incorrect because the level numbers in COBOL are not restricted to odd numbers only.

Option D) 01 to 49 - This option is correct because the valid level numbers in COBOL programming range from 01 to 49.

Therefore, the correct answer is Option D) 01 to 49.

What is the difference between comp and comp-3 usage.

  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.

What is file status 92?

  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

What can be the possible cause for SOC-7 error?

  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

How many bytes will a S9(8) COMP field occupy?

  1. 2

  2. 4

  3. 8

  4. 16


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of COMP fields in COBOL.

In COBOL, the COMP field is used to store numeric data. The size of a COMP field is determined by the number of bytes it occupies in memory.

In this case, the S9(8) represents a signed numeric field with a length of 8 digits. The "S" indicates that the field is signed, and the "9(8)" indicates that it can hold 8 digits.

In COBOL, the COMP field is typically represented using the binary format, which means that each digit occupies 4 bits. Therefore, to calculate the number of bytes required for the field, we divide the number of digits by 2.

In this case, the S9(8) COMP field has 8 digits, so it will occupy 8/2 = 4 bytes of memory.

Based on this explanation, the correct answer is B) 4.

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

How many subscripts or indexes are allowed for an OCCURS clause?

  1. 4

  2. 5

  3. 6

  4. 7


Correct Option: D

What are the minimum requirements to compile a program without errors?

  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

How JCL steps can be skipped?

  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

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.

  1. a, b, & c

  2. a only

  3. a & b only

  4. b only


Correct Option: A
- Hide questions