Tag: mainframe

Questions Related to mainframe

What does Rexx stand for

  1. Reactived Extendable Exchange language

  2. Restructured Extended Executor language

  3. Reactive Enforcement Execution Exchange language

  4. None of the above


Correct Option: B

What is the maximum value of the variable declared as PIC S9(9) ?

  1. 9

  2. 99999999

  3. 999999999

  4. None of above


Correct Option: C

AI Explanation

To answer this question, we need to understand the concept of the "PIC S9(9)" declaration in COBOL.

In COBOL, "PIC" stands for Picture Clause, which is used to define the format and characteristics of a data item. "S9(9)" is a specific format used to declare a signed numeric field with a length of 9 digits.

In the "S9(9)" format, the first digit represents the sign of the number (positive or negative), and the remaining 8 digits represent the magnitude of the number.

The maximum value that can be represented by a 9-digit signed number is 999999999.

Let's go through each option to understand why it is correct or incorrect:

Option A) 9 - This option is incorrect because it represents a single digit number, while the "PIC S9(9)" declaration represents a 9-digit number.

Option B) 99999999 - This option is incorrect because it represents an 8-digit number, while the "PIC S9(9)" declaration represents a 9-digit number.

Option C) 999999999 - This option is correct because it represents a 9-digit number, which is the maximum value that can be represented by the "PIC S9(9)" declaration.

Option D) None of above - This option is incorrect because option C, 999999999, is the correct answer.

The correct answer is C. 999999999. This option is correct because it represents the maximum value that can be stored in a variable declared as PIC S9(9).

Which file open mode option throws error?

  1. EXTEND

  2. OUTPUT

  3. I-O

  4. INPUT

  5. None of the above


Correct Option: E

What is the default recording mode for QSAM file?

  1. Recording mode - F

  2. Recording mode - V

  3. Recording mode - U

  4. Recording mode - S

  5. No default mode for QSAM


Correct Option: A
  1. FILE SECTION

  2. REPORT-SECTION

  3. SCREEN-SECTION

  4. STORAGE-SECTION


Correct Option: D
  1. Binary storage

  2. Packed Decimal

  3. Hexa decimal

  4. Decimal


Correct Option: A

77 COUNT-VAR PIC 9 VALUE ZERO. 01 DATA-VAR PIC X(12). . . . INSPECT DATA-VAR TALLYING COUNT-VAR FOR LEADING “R” REPLACING FIRST “A” BY “2” AFTER INITIAL “Q” Refer to code above , If DATA-2 = RRAQADRRYRBB What are values for COUNT-VAR & DATA-VAR after the execution of INSPECT Statement ?

  1. 3 , RRAQ2DRRYRBB

  2. 0 , RR2Q2DRRYRBB

  3. 2 , RRAQ2DRRYRBB

  4. 2 , RR2QADRRYRBB


Correct Option: C

AI Explanation

To answer this question, let's go through the execution of the INSPECT statement step by step:

Given:

  • COUNT-VAR is initialized to 0.
  • DATA-VAR is initialized to "RRAQADRRYRBB".
  • The INSPECT statement is used to perform operations on DATA-VAR.
  1. Tallying COUNT-VAR for Leading "R":

    • This operation counts the number of occurrences of the leading character "R" in DATA-VAR.
    • Since the leading character in DATA-VAR is "R", COUNT-VAR is incremented by 1. COUNT-VAR becomes 1.
  2. Replacing First "A" by "2" After Initial "Q":

    • This operation replaces the first occurrence of "A" after the initial occurrence of "Q" with "2".
    • In DATA-VAR, the first occurrence of "A" after the initial "Q" is at the fourth position.
    • The "A" at the fourth position is replaced by "2". DATA-VAR becomes "RRAQ2DRRYRBB".

After the execution of the INSPECT statement, the values for COUNT-VAR and DATA-VAR are as follows:

COUNT-VAR: 1 (as it was incremented by 1 during the tallying operation) DATA-VAR: "RRAQ2DRRYRBB" (as the replacement operation was performed)

Therefore, the correct answer is option C) 1, RRAQ2DRRYRBB.

  1. Compilation Error

  2. Executes successfully

  3. Run time Error

  4. Logical Error


Correct Option: B

Merging two sequential files with single statement can done using ____ Option ?

  1. MER

  2. MERGE

  3. COMBINE

  4. JOIN


Correct Option: B