1.
PIC S9 (4) results 3 bytes. S9 is of .................. clause.
Correct Answer
C. COMP3
Explanation
The correct answer is COMP3. PIC S9 (4) indicates that the data item is a signed numeric field with a length of 4 bytes. COMP3 is a COBOL data type that represents a packed decimal number. Packed decimal numbers are used for efficient storage of decimal data and are commonly used in financial calculations.
2.
If after an arithmetic operation, the result exceeds the largest value that can be accommodated in the result field, the error is called a ____________.
Correct Answer
B. SIZE ERROR
Explanation
If after an arithmetic operation, the result exceeds the largest value that can be accommodated in the result field, the error is called a SIZE ERROR. This error occurs when the result of the arithmetic operation is too large to fit within the designated memory space for the result. It indicates that the size of the result field is not sufficient to hold the calculated value, resulting in an error.
3.
77 A PIC $ZZ999.
MOVE 985 TO A.
What would be the output?
Correct Answer
C. $ 985
Explanation
The given code snippet is written in COBOL programming language. In COBOL, the PIC clause is used to define the format of a variable. In this case, the PIC $ZZ999 indicates that the variable A is a character variable with a maximum length of 5 characters, where the first character is a dollar sign and the remaining four characters can be any digit from 0 to 9.
The MOVE statement is used to assign the value 985 to the variable A. Since A is defined as a character variable, the value 985 will be stored as a string.
Therefore, the output would be "$ 985" because the variable A is defined with a maximum length of 5 characters and the value 985 will be right-aligned within the variable, with two spaces before it.
4.
The __________ clause eliminates the need for separate entries for repeated data item.
Correct Answer
D. OCCURS
Explanation
The OCCURS clause in a programming language eliminates the need for separate entries for repeated data items. It allows for the declaration of arrays or tables, where multiple occurrences of the same data item can be stored in a single entry. This helps to optimize memory usage and simplifies the coding process by reducing the need for repetitive declarations.
5.
____Gives the Flexibility of Defining Data-names With the Same Name
Correct Answer
B. QUALIFICATION
Explanation
The correct answer is QUALIFICATION because it allows for the flexibility of defining data-names with the same name. This means that multiple data-names can be defined with the same name, allowing for easier organization and management of data within a program. This can be particularly useful when working with large or complex datasets.
6.
What is true regarding REDEFINES clause? (dataname-2 REDEFINES dataname-1)
Correct Answer
D. Used to allow the same storage location to be referenced by different datanames
Explanation
The REDEFINES clause is used to allow the same storage location to be referenced by different datanames. It is not dependent on the level number or the levels of the datanames being different. It can be used at any level in the FILE SECTION.
7.
How do you come out of an EVALUATE statement?
Correct Answer
A. After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code.
Explanation
After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code. This means that there is no need to use any of the provided options (STOP RUN, ESCAPE, SKIP) to exit the EVALUATE statement. The control flow will continue normally to the next statement after the EVALUATE block.
8.
On which column position we can write continuation?
Correct Answer
C. 7
9.
The REDEFINES clause can appear in the same data description entry which contains an OCCURS clause.
Correct Answer
B. False
Explanation
The REDEFINES clause cannot appear in the same data description entry which contains an OCCURS clause. The REDEFINES clause is used to define two or more data items that occupy the same memory location, while the OCCURS clause is used to define a repeating group of data items. Therefore, these two clauses cannot be used together in the same data description entry.
10.
The __________ CLAUSE must be used only with the special level number 66.
Correct Answer
A. RENAMES
Explanation
The RENAMES clause must be used only with the special level number 66. This clause allows a data item to be referenced by a different name, providing an alternate way to access the same data. However, it is important to note that this clause should only be used with level number 66, as using it with other level numbers may result in unexpected behavior or errors in the program.
11.
What is the resultant value of C from the statement, if initially A=30 and B=60
MOVE A B TO C
Correct Answer
C. Operation can’t performed because of improper syntax
Explanation
The statement "MOVE A B TO C" is not a valid syntax in most programming languages. The correct syntax for assigning the value of A to C would be "C = A". Therefore, the operation cannot be performed because of improper syntax.
12.
Which of the following is true related to the ‘.’ Picture character?
Correct Answer
C. 01 COST PIC 999.99
Explanation
The correct answer is 01 COST PIC 999.99. This is because the '.' picture character is used to represent a decimal point in COBOL. Therefore, the correct statement is the one that includes the decimal point after the second digit, indicating that the field can have two decimal places.
13.
A Single __________ statement can substitute Multiple Arithmetic Statements.
Correct Answer
A. Compute
Explanation
A single "compute" statement can substitute multiple arithmetic statements because the term "compute" implies the act of performing calculations or mathematical operations. Therefore, by using a single "compute" statement, one can perform multiple arithmetic operations simultaneously, eliminating the need for separate statements for each operation.
14.
A COBOL word can contain a blank.
Correct Answer
B. False
Explanation
A COBOL word cannot contain a blank. In COBOL, a word is defined as a sequence of characters that starts with an alphabetic character and can be followed by alphabetic characters, digits, or hyphens. It cannot contain any blank spaces. Therefore, the statement "A COBOL word can contain a blank" is false.
15.
What is the edited value of the following
PICTURE Value Internal Representation
9999CR 2359 ______________.
Correct Answer
2359
Explanation
The value of "PICTURE" is given as "9999CR" and the corresponding internal representation is "2359". Therefore, the edited value of "PICTURE" is "2359".
16.
LINKAGE-SECTION present which DIVISION.
Correct Answer
C. DATA DIVISION
Explanation
The given correct answer is DATA DIVISION. In COBOL programming language, the DATA DIVISION is used to define the data structures and variables that will be used in the program. It is responsible for declaring the data types, record layouts, and file structures. The DATA DIVISION is an essential part of the program as it defines the data elements and their characteristics, which are necessary for processing in the PROCEDURE DIVISION.
17.
Every Paragraph should end with a Period ( . )
Correct Answer
A. True
Explanation
The given correct answer is "True." However, without any context or specific question provided, it is impossible to generate an explanation for why "True" is the correct answer.
18.
_______ level number indicates highest level in data hierarchy & refers to entire data set contained in it.
Correct Answer
C. 01
Explanation
The correct answer is 01. This level number indicates the highest level in the data hierarchy and refers to the entire data set contained in it.
19.
A COBOL word can have national characters.
Correct Answer
B. False
Explanation
COBOL words cannot have national characters. National characters are typically used to represent non-ASCII characters and are not supported in COBOL. Therefore, the correct answer is false.
20.
Every Data name used in the program must be defined in PROCEDURE DIVISION.
Correct Answer
B. False
Explanation
In the given statement, it is stated that every data name used in the program must be defined in the PROCEDURE DIVISION. However, this statement is incorrect. Data names can be defined in various divisions of a program, such as the DATA DIVISION or WORKING-STORAGE SECTION. The PROCEDURE DIVISION is primarily used for writing the actual logic and operations of the program, rather than defining data names. Therefore, the correct answer is False.