0

mainframe Online Quiz - 72

Description: mainframe Online Quiz - 72
Number of Questions: 20
Created by:
Tags: mainframe
Attempted 0/20 Correct 0 Score 0

Which of the following are syntactically correct? (1) 01 REC-1 PIC SX(4). (2) 01 REC-2 PIC S9(4). (3) 01 REC-1 PIC V99. (4) 01 REC-1 PIC P99. (5) 01 REC-1 PIC 9(4)S. (6) 01 REC 1 PIC X(4).

  1. 2, 3 and 6

  2. 3, 4 and 6

  3. 1, 2 and 3

  4. 2, 3 and 4


Correct Option: D

AI Explanation

To determine which of the given options are syntactically correct, we need to understand the syntax rules for COBOL picture clauses.

In COBOL, the PICTURE clause is used to define the format and type of data items. It consists of a combination of characters that represent the format of the data item.

Let's go through each option to determine its correctness:

Option A) 01 REC-1 PIC SX(4) This option is incorrect. The 'S' in the PICTURE clause indicates a signed numeric field, but 'X' is not a valid format for a numeric field. The correct format for a signed numeric field would be 'S9' followed by the number of digits.

Option B) 01 REC-2 PIC S9(4) This option is correct. 'S9(4)' represents a signed numeric field with 4 digits.

Option C) 01 REC-1 PIC V99 This option is correct. 'V99' represents a numeric field with 2 decimal places.

Option D) 01 REC-1 PIC P99 This option is correct. 'P99' represents a numeric field with 2 decimal places and an implicit decimal point.

Option E) 01 REC-1 PIC 9(4)S This option is incorrect. The 'S' should come before the number of digits in a signed numeric field. The correct format would be 'S9(4)'.

Option F) 01 REC 1 PIC X(4) This option is incorrect. There should be a hyphen (-) between 'REC' and '1' in the level number. The correct format would be '01 REC-1 PIC X(4)'.

Based on the above analysis, the correct options are 2, 3, and 4. Therefore, the correct answer is D.

COMPUTE A=B is a valid statement

  1. True

  2. False


Correct Option: A

Maximum number of INSTREAM procedures

  1. 10

  2. 15

  3. 20

  4. 25


Correct Option: B

5 generations of a GDG already exist. Refer 1st generation in the JCL

  1. GDG (-4)

  2. GDG (-3)

  3. GDG (-5)

  4. GDG (1)


Correct Option: A

The parameter used to specify whether job is to be held until further notice or for syntax checking

  1. HOLD

  2. TYPERUN

  3. TYPRUN

  4. SCAN


Correct Option: C
  1. Multiple jobs are submitted

  2. Job will abend

  3. Only one step gets executed

  4. Only first job will be submitted


Correct Option: A

Which of the following functions can DD statements perform?

  1. Tell the system which data set to access

  2. Request a printer to produce the job output

  3. Indicate where to store new data sets

  4. Initiate a new program


Correct Option: A,B,C
  1. Programs must run sequentially

  2. Programs must be dependent on each other

  3. Programs must access the same databases

  4. Programs must have the same accounting information


Correct Option: A,B,C
  1. //TEST*1

  2. // JOB13

  3. //$ABCD

  4. //STEPSEVEN


Correct Option: C

What are the correct values for the DSN parameter of a temporary data set?

  1. &NAME&(TEMP)

  2. &&TEMP(NAME)

  3. &&NAME

  4. &NAME


Correct Option: B,C

SET is also a valid AMS command.

  1. True

  2. False


Correct Option: A

Which of the following PIC definitions can be used in the declaration of a record of a sequential file that will be used as INPUT

  1. PIC X(9)

  2. PIC S9(4) COMP

  3. PIC Z(4)

  4. PIC 9(4)V99

  5. PIC 9(4).99


Correct Option: A,B,D

"Which tests are allowed with the following variable? 01 END-OF-FILE PIC X. 88 EOF VALUE 'N'."

  1. IF EOF THEN …

  2. IF EOF IS TRUE THEN ...

  3. IF END-OF-FILE = 'Y' THEN ...

  4. IF END-OF-FILE THEN ...


Correct Option: A,C
  1. EVALUATE A WHEN 0 DISPLAY 'A = 0' WHEN 5 DISPLAY 'A = 5' WHEN OTHER DISPLAY 'A IS NOT 0 NOR 5' END-EVALUATE

  2. EVALUATE TRUE WHEN A=0 DISPLAY 'A = 0' WHEN A=5 DISPLAY 'A = 5' WHEN OTHER DISPLAY 'A IS NOT 0 OR 5' END-EVALUATE

  3. EVALUATE A WHEN A=0 DISPLAY 'A = 0' WHEN A=5 DISPLAY 'A = 5' WHEN OTHER DISPLAY 'A IS NOT 0 NOR 5' END-EVALUATE

  4. none


Correct Option: C

Which of the following statements concerning files are true?

  1. the FD entry in the DATA DIVISION gives a description of the structure of a file.

  2. the first record is automatically read on opening a file.

  3. if a file is opened in I-O mode you can use this file for reading as well as for writing.

  4. you can not read indexed files from a COBOL program.

  5. in the SELECT clause you have to give a complete description of the exact location of the file.


Correct Option: A,C

What is the content of RESULT after execution of the following COBOL instruction. The start value of RESULT is 0. PERFORM VARYING C FROM 1 BY 1 UNTIL C = 6 COMPUTE RESULT = RESULT + 1 END-PERFORM

  1. 4

  2. 5

  3. 6

  4. 7


Correct Option: B

Can a SEARCH be applied to a table which does not have an INDEX defined?

  1. No

  2. Yes

  3. can't say

  4. none


Correct Option: A
- Hide questions