Tag: mainframe

Questions Related to mainframe

What is the maximum size of a 01 level item in COBOL II?

  1. 16777215

  2. 16777200

  3. 1677250

  4. 16772150


Correct Option: A

AI Explanation

To answer this question, you need to have an understanding of the COBOL II programming language.

In COBOL II, the maximum size of a 01 level item is determined by the PIC clause. The PIC clause defines the data type and length of the item.

The PIC X clause is used to define alphanumeric data. Each character occupies one byte of storage. Therefore, the maximum size of a 01 level item defined with PIC X is determined by the maximum number of bytes that can be allocated for a single item.

In COBOL II, the maximum number of bytes that can be allocated for a single item is 16,777,215 bytes. This corresponds to option A.

Let's go through each option to understand why they are correct or incorrect:

Option A) 16777215 - This option is correct because it represents the maximum number of bytes that can be allocated for a 01 level item in COBOL II.

Option B) 16777200 - This option is incorrect because it does not represent the maximum number of bytes that can be allocated for a 01 level item in COBOL II.

Option C) 1677250 - This option is incorrect because it does not represent the maximum number of bytes that can be allocated for a 01 level item in COBOL II.

Option D) 16772150 - This option is incorrect because it does not represent the maximum number of bytes that can be allocated for a 01 level item in COBOL II.

The correct answer is option A. This option is correct because it represents the maximum size of a 01 level item in COBOL II.

05 FIELDA PIC XXXX VALUE 'ABCb'. 05 FIELDB PIC XXXX VALUE SPACES. .... MOVE FUNCTION REVERSE(FIELDA) TO FIELDB. Which one of the following is the content of FIELDB following execution of the MOVE statement shown in the sample code above?

  1. bABC

  2. bCBA

  3. bcba

  4. ABbC

  5. ABCb


Correct Option: A
  1. A READ statement is missing in the MAINLINE section after the PERFORM.

  2. MAINLINE must not contain any statements other than the PERFORM statement.

  3. S-EOF-CHECK is not properly initialized prior to the PERFORM statement

  4. The line "SET S-END-OF-FILE TO TRUE" is not a valid statement.

  5. In working storage, an 88 level must be defined for values of S-EOF-CHECK other than 'N' and 'Y'.


Correct Option: C

Sample Code 0100 IDENTIFICATION DIVISION. 0200 PROGRAM-ID. AM822P115. Referring to the sample code above, which one of the following statements is correct?

  1. There should not be a hyphen between PROGRAM and ID.

  2. Line 0100 should be DIVISION-ID.

  3. The compiler shortened the program name to "AM822P11".

  4. Line 0200 should be PROGRAM IDENTIFICATION. AM822P115.

  5. The program name must not contain numbers.


Correct Option: C

Table Definition Sample data shown below. 100 entries maximum. Data is ordered by item. Limit table size to actual data. Item Price D00025A 23.50 D00025B 29.50 D00025C 33.99 D00026A 11.20 Which one of the following is the proper COBOL description for the above table definition?

  1. 01 PRICE-TABLE. 05 PRICE-GROUP OCCURS 1 TO 100 TIMES ASCENDING KEY IS ITEM-CODE. 10 ITEM-CODE PIC X(7). 10 ITEM-PRICE PIC 99V99.

  2. 01 PRICE-TABLE. 05 PRICE-GROUP OCCURS UP TO 100 TIMES DEPENDING ON WS-ITEM-COUNT ASCENDING KEY IS ITEM-CODE. 10 ITEM-CODE PIC X(7). 10 ITEM-PRICE PIC 99V99.

  3. 01 PRICE-TABLE. 05 PRICE-GROUP OCCURS 1 TO 100 TIMES DEPENDING ON WS-ITEM-COUNT ASCENDING KEY IS ITEM-CODE. 10 ITEM-CODE PIC X(7). 10 ITEM-PRICE PIC 99V99.

  4. 01 PRICE-TABLE. 05 PRICE-GROUP OCCURS UP TO 100 TIMES DEPENDING ON WS-ITEM-COUNT AND KEY ITEM-CODE. 10 ITEM-CODE PIC X(7). 10 ITEM-PRICE PIC 99V99.


Correct Option: C
  1. 10 for sequential, 120 for VSAM

  2. 16 for sequential, 123 for VSAM

  3. 10 for sequential, 10 for VSAM

  4. 16 for sequential, 16 for VSAM


Correct Option: B
  1. The job can execute for 1440 CPU secs

  2. The job can execute for 1440 CPU minutes

  3. No CPU time limit to be applied

  4. None of the above


Correct Option: C