Simple COBOL Quiz
Description: Simple COBOL Quiz  
Number of Questions: 11  
Created by: Aliensbrain Bot  
Tags: cobol 

Divide A into B

Divide A by B

Divide A into B Giving C

Divide A by B Giving C

Any part of the file section

Any part of the workingstorage section

Any part of the data division

Multiply corresponding record1 by record2

Add corresponding record1 to record2

Move corresponding record1 to record2

Subtract corresponding record1 from record2
A record can be described using which of these level numbers

01 to 49 (both inclusive) and 77

01 to 49 (both inclusive)

All odd numbers from 01 to 49

All even numbers from 01 to 49
AI Explanation
To answer this question, you need to understand the concept of level numbers in COBOL.
In COBOL, a level number is used to define the structure and hierarchy of data items within a record or data structure. It indicates the nesting level of the data item.
Let's go through each option to understand which level numbers can be used to describe a record:
Option A) 01 to 49 (both inclusive) and 77  This option is incorrect. While level numbers 01 to 49 can be used to define data items within a record, level number 77 is used to define a special type of data item called a "condition name". It is not used to describe the structure of a record.
Option B) 01 to 49 (both inclusive)  This option is correct. Level numbers 01 to 49 can be used to define data items within a COBOL record. These level numbers represent the hierarchy of the data items, with level 01 being the highest level and level 49 being the lowest level.
Option C) All odd numbers from 01 to 49  This option is incorrect. While level numbers 01 to 49 can be used to define data items within a record, there is no requirement or convention to use only odd numbers for defining levels.
Option D) All even numbers from 01 to 49  This option is incorrect. While level numbers 01 to 49 can be used to define data items within a record, there is no requirement or convention to use only even numbers for defining levels.
The correct answer is option B) 01 to 49 (both inclusive). This option is correct because level numbers 01 to 49 can be used to describe the structure and hierarchy of data items within a COBOL record.

Financial sector and engineering

Graphic design and education

None of these

Comp

Comp1

Display

Comp3
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. Comp1: 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 Comp1, 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. Comp3: 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 Comp3, it would require 3 bytes of storage, which matches the given requirement. Hence, Option D is correct.
Therefore, the answer is: D. Comp3.

Level 88

Level 77

Level 66

Level 01
In COBOL CANCEL statement used in which type of CALL

Dynamic CALL

Static CALL

Both A and B

None of the above
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
using an ____number of digits for PACKED DECIMAL (COMP3) is 5% to 20% Faster than using an_____ number of digits .

Even, Even

Odd, Even

Odd, Odd

Even, Odd
AI Explanation
To answer this question, you need to understand the concept of PACKED DECIMAL (COMP3) and how the number of digits affects its performance.
PACKED DECIMAL (COMP3) is a data type used in computer programming to store decimal numbers. It is commonly used in languages like COBOL. In this format, each digit is encoded in a nibble (half a byte), and the sign is stored in the last nibble.
Now let's analyze each option to understand why the correct answer is option B:
Option A) Even, Even  This option suggests using an even number of digits for PACKED DECIMAL (COMP3) in both cases. However, this is not the correct answer because the performance is not affected by using an even number of digits in both cases.
Option B) Odd, Even  This option suggests using an odd number of digits for PACKED DECIMAL (COMP3) in the first case and an even number of digits in the second case. This is the correct answer because using an odd number of digits in the first case can result in faster performance compared to using an even number of digits.
Option C) Odd, Odd  This option suggests using an odd number of digits for PACKED DECIMAL (COMP3) in both cases. However, this is not the correct answer because the performance is not affected by using an odd number of digits in both cases.
Option D) Even, Odd  This option suggests using an even number of digits for PACKED DECIMAL (COMP3) in the first case and an odd number of digits in the second case. However, this is not the correct answer because the performance is not affected by using an odd number of digits in the second case.
Therefore, the correct answer is option B) Odd, Even. This option is correct because using an odd number of digits for PACKED DECIMAL (COMP3) can result in faster performance compared to using an even number of digits.
Which one is incorrect in the following??

If A is greater than B go to ParaA

If C is not positive go to ParaC

If D is not alphanumeric go to ParaD

If E = 3 or 4 go to Paravalid