Tag: cobol

Questions Related to cobol

  1. Divide A into B

  2. Divide A by B

  3. Divide A into B Giving C

  4. Divide A by B Giving C


Correct Option: B

77-level entries are permitted in _________________.

  1. Any part of the file section

  2. Any part of the working-storage section

  3. Any part of the data division


Correct Option: C

AI Explanation

To answer this question, you need to understand the concept of level entries in COBOL programming.

In COBOL, level numbers are used to define the structure and hierarchy of data items. The level number indicates the level of detail or complexity of the data item.

In this question, the correct answer is option C) Any part of the data division.

The data division is where data items and record structures are defined in a COBOL program. Level entries can be defined at any part of the data division, such as the file section, working-storage section, or linkage section. So, options A) and B) are incorrect.

Therefore, the correct answer is C) Any part of the data division. Level entries can be defined at any level in the data division to define the structure of the data used in the program.

  1. Multiply corresponding record1 by record2

  2. Add corresponding record1 to record2

  3. Move corresponding record1 to record2

  4. Subtract corresponding record1 from record2


Correct Option: A
  1. 01 to 49 (both inclusive) and 77

  2. 01 to 49 (both inclusive)

  3. All odd numbers from 01 to 49

  4. All even numbers from 01 to 49


Correct Option: B
  1. Financial sector and engineering

  2. Graphic design and education

  3. None of these


Correct Option:

A data item Var1 described with PIC S9(4) requires 3 bytes of storage if its usage clause is

  1. Comp

  2. Comp-1

  3. Display

  4. Comp-3


Correct Option: D
Explanation:

To solve this question, the user needs to have an understanding of the different USAGE clauses in COBOL and the storage requirements for each of them.

  • A. Comp: This usage clause is a binary format that occupies 2 bytes of storage. Therefore, if the data item Var1 is described with PIC S9(4) and its usage clause is Comp, it would require 2 bytes of storage, which is less than the given 3 bytes. Hence, Option A is incorrect.

  • B. Comp-1: This usage clause is a packed decimal format that occupies 4 bytes of storage. Therefore, if the data item Var1 is described with PIC S9(4) and its usage clause is Comp-1, it would require 4 bytes of storage, which is more than the given 3 bytes. Hence, Option B is incorrect.

  • C. Display: This usage clause is an alphanumeric format that occupies 1 byte for each character of the data item. Since the data item Var1 is described with PIC S9(4), it would require 4 characters to store its value. Therefore, if the usage clause is Display, it would require 4 bytes of storage, which is more than the given 3 bytes. Hence, Option C is incorrect.

  • D. Comp-3: This usage clause is a packed decimal format that occupies 3 bytes of storage. Therefore, if the data item Var1 is described with PIC S9(4) and its usage clause is Comp-3, it would require 3 bytes of storage, which matches the given requirement. Hence, Option D is correct.

Therefore, the answer is: D. Comp-3.

  1. Level 88

  2. Level 77

  3. Level 66

  4. Level 01


Correct Option: C
  1. Dynamic CALL

  2. Static CALL

  3. Both A and B

  4. None of the above


Correct Option: A
Explanation:

To solve this question, the user needs to have knowledge of the COBOL programming language and the different types of CALL statements used in it.

The CANCEL statement is used to cancel an active COBOL program, either from within the program or by another program. Specifically, it is used to cancel a dynamic CALL statement.

Therefore, the correct answer is:

The Answer is: A. Dynamic CALL