1.
Which of the following is valid COBOL word?
Correct Answer
A. B12-4
Explanation
The valid COBOL word in this question is B12-4. COBOL words can contain letters, numbers, and hyphens, but cannot start with a hyphen. Therefore, B12-4 is a valid COBOL word as it starts with a letter and includes numbers and a hyphen. The other options, –GROSS, OVER TIME, and GROSS_SALARY, are not valid COBOL words because they either contain spaces or start with a hyphen.
2.
Which of the following is not a figurative constant?
Correct Answer
B. QUOTE
Explanation
Among the options provided, QUOTE is not a figurative constant in COBOL.
Figurative constants in COBOL are special reserved words that represent specific non-numeric or alphanumeric values. They are used to initialize or manipulate data items. The other options, SPACES, BLANK, and LOW-VALUE, are all examples of figurative constants in COBOL:
SPACES represents a string of spaces.
BLANK represents a single space.
LOW-VALUE represents the lowest possible non-displayable character.
3.
What is the edited value of the picture clause
PIC field 9999+
Numeric value moved to the field -382 and the Edited value is
Correct Answer
A. 0382-
Explanation
The edited value of the picture clause PIC field 9999+ after moving the numeric value -382 to the field would be 0382-. This is because the picture clause specifies that the field should have 4 digits, and the plus sign indicates that it can also have a sign. The numeric value -382 is moved to the field and the resulting edited value is 0382- where the minus sign indicates the negative sign.
4.
Which division is used to specify the computer used by the program?
Correct Answer
B. Environment Division
Explanation
The Environment Division is used to specify the computer used by the program. This division contains statements that define the characteristics of the computer system on which the program will be executed, such as the hardware configuration, operating system, and other environmental settings. It allows the program to interact with the specific computer environment in which it is running.
5.
Initially A=30, B=60IF A = 40
DISPLAY ‘ABC’
ELSE
NEXT SENTENCE
END-IF
MOVE 90 TO B.
DISPLAY B.
What is the output of the program?
Correct Answer
C. 90
Explanation
The provided COBOL program initializes two variables, A and B, with values 30 and 60, respectively. It then checks if A is equal to 40. Since A is not equal to 40, it proceeds to assign the value 90 to B and displays the value of B, which is now 90. Therefore, the output of the program is "90."
6.
In WRITE statement, it is required to mention the record name and not the file name.
Correct Answer
A. True
Explanation
In the WRITE statement, the record name should be mentioned instead of the file name. This means that when writing data to a file, the specific record within the file should be specified rather than just the file itself. This ensures that the data is written to the correct location within the file. Therefore, the statement is true.
7.
S9(7) COMP-3 field occupy _________ bytes.
Correct Answer
A. 4
Explanation
The S9(7) COMP-3 field is a packed decimal field that occupies 4 bytes. Packed decimal fields store numeric values in a compressed format, where each digit is represented by a nibble (half a byte). The S9(7) format indicates that the field can store up to 7 digits, including the sign. Since each digit requires a nibble, and there is an additional nibble for the sign, the total number of nibbles required is 8. However, since a nibble is half a byte, the field occupies 4 bytes.
8.
________ clause used for the purpose allows the said area to be referred to by more than one data name with different sizes and pictures.
Correct Answer
B. REDEFINES
Explanation
The correct answer is "REDEFINES". In COBOL programming, the REDEFINES clause is used to allow a data area to be referred to by more than one data name with different sizes and pictures. This allows for efficient memory usage and flexibility in accessing and manipulating data.
9.
A data name gives references to the storage space to the memory where the actual value is stored.
Correct Answer
A. True
Explanation
A data name is a variable or identifier that is used to refer to a specific location in the computer's memory where a value is stored. This allows programmers to easily access and manipulate the stored value by using the data name. Therefore, the statement "A data name gives references to the storage space in the memory where the actual value is stored" is true.
10.
. If A=10, B=20, C=30,D=0
Then the result of operation ______________
ADD A B TO C GIVING D
Correct Answer
A. 60
Explanation
The operation ADD A B TO C GIVING D means you add the values of A and B, then add that sum to C, and store the final result in D. The crucial point is that C is not modified; only D receives the final sum. With the initial values =10A=10, =20B=20, and =30C=30, the calculation is D=A+B+C=10+20+30=60. Thus, D is 60, while C remains unchanged.
11.
_______ verb causes the termination of the execution of object program.
Correct Answer
A. STOP RUN
Explanation
The STOP RUN verb is used to terminate the execution of an object program. It is typically used at the end of a program to indicate that the program has finished running and should be stopped. The STOP RUN statement is specific to COBOL programming language and is used to gracefully exit the program.
12.
What is the difference between COMP & COMP-3?
Correct Answer
C. packed decimal format & binary format,
Explanation
The difference between COMP and COMP-3 is that COMP uses binary format to store numeric values, while COMP-3 uses packed decimal format. In binary format, each digit of the number is represented by a series of 0s and 1s, allowing for efficient storage and arithmetic operations. On the other hand, packed decimal format stores each digit of the number in a separate nibble, with the sign stored in the last nibble. This format is more space-efficient but requires additional processing to perform arithmetic operations.
13.
Which of the following is false among the statements?
Correct Answer
C. 77 level can be sub divided themselves
Explanation
The statement "77 level can be sub divided themselves" is false. In COBOL, the 77 level is used to define elementary level items, which cannot be further subdivided. The 77 level is typically used to declare variables or data items that hold simple values like numbers or characters. On the other hand, higher levels like 88 and 66 can be used to define conditions or aliases for other data items.
14.
A ____means the specific value which remains unchanged throughout the execution of program.
Correct Answer
A. LITERAL
Explanation
A LITERAL means the specific value which remains unchanged throughout the execution of the program. In programming, a literal is a value that is directly written into the code and does not change during runtime. It is used to represent fixed values such as numbers, characters, or strings. LITERALS are often used to assign initial values to variables or as operands in expressions. They are not affected by any calculations or operations performed in the program and remain constant throughout its execution.
15.
The USAGE clause can be specified at any level.
Correct Answer
A. True
Explanation
The USAGE clause in a programming language can be specified at any level, meaning it can be used in different parts of the code or at various stages of the program. This allows for flexibility and customization in how the USAGE clause is applied and utilized within the program.
16.
Which of the following is not a valid delimiter in COBOL?
Correct Answer
D. –
Explanation
The answer is "-" because it is not a valid delimiter in COBOL. In COBOL, the valid delimiters are comma (,), period (.), and semicolon (;). The hyphen (-) is not recognized as a delimiter in COBOL.
17.
In a COBOL program, specify the column position range of Area A .
Correct Answer
A. 8-11
Explanation
The correct answer is 8-11. In COBOL programs, the column position range of Area A is from column 8 to column 11. This means that any statements or code written in Area A should be placed within these column positions.
18.
A numeric literal can have maximum of 18 digits.
Correct Answer
A. True
Explanation
A numeric literal refers to a specific value written directly in the code, without any variables or calculations. In this case, the statement suggests that a numeric literal can have a maximum of 18 digits. This means that any number written directly in the code cannot exceed 18 digits. Therefore, the answer "True" indicates that the statement is correct.
19.
The standard left-hand alignment of alphanumeric or alphabetic data can be reversed by using the _________CLAUSE.
Correct Answer
A. JUSTIFIED
Explanation
The standard left-hand alignment of alphanumeric or alphabetic data can be reversed by using the JUSTIFIED clause.
20.
What is the edited value of the following
PICTURE Value Internal Representation
$$$$$ 009 ______________
Correct Answer
A. Bbb$9