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

Sample Code Field in working storage: 05 S-EOF-CHECK PIC X(01). 88 S-NOT-END-OF-FILE VALUE 'N'. 88 S-END-OF-FILE VALUE 'Y'. MAINLINE. SET S-END-OF-FILE TO TRUE PERFORM A0100-PRINT-DETAIL-AND-FOOTERS UNTIL S-END-OF-FILE END-PERFORM. Using the sample working storage and mainline section of a program, which one of the following is the coding error that occurred in the sample above?

  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
  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
  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

Sample code WORKING-STORAGE SECTION. 01 WORK-TABLE. 05 WK-ALPHA PIC A(2) VALUE 'AB'. 05 FILLER PIC X VALUE ''. 05 WK-ALPHANUM PIC X(4) VALUE 'CDEF'. 05 PIC X VALUE ''. 05 WK-NUM PIC 999. 05 PIC X VALUE '*'. PROCEDURE DIVISION. .... INITIALIZE WORK-TABLE. After execution of the statement in the sample code above, which one of the following values does WORK-TABLE contain? NOTE: b = BLANK or UNPRINTABLE HEXADECIMAL character

  1. bb*bbbb*bb0*

  2. AB*CDEF*bb0*

  3. ABbCDEFb000b

  4. bb*bbbb*000*


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