1.
The following statement WRITE OUT-REC. Which one of the following modes of operating the Sequential file is not true?
Correct Answer
A. OPEN INPUT
Explanation
The correct answer is OPEN INPUT. This is not a valid mode of operating a sequential file. The OPEN INPUT statement is used to open a file for reading data from it, but it does not allow for writing or modifying the file. Therefore, it is not true that OPEN INPUT can be used to operate a sequential file in all modes.
2.
The UNSTRING verb is used to transfer data from several sources to one receiving field.
Correct Answer
B. NO
Explanation
The UNSTRING verb is used to split a string into multiple fields based on a delimiter. It does not transfer data from several sources to one receiving field. Therefore, the correct answer is NO.
3.
Indicate which of the following is true about the 88 level entry.
Correct Answer
D. It is used for a condition name which can have either a true or false.
Explanation
The 88 level entry in COBOL is used for a condition name which can have either a true or false value. It is typically used in the PROCEDURE DIVISION to test the condition and execute different sections of code based on the result. This allows for more efficient and readable code as the condition name can be used instead of writing out the full condition each time it is tested.
4.
IF NOT AGE LESS THAN 30 AND 40
GO TO PARA-AGE-MIDDLES. The controls will go to the paragraph named PARA-AGE-MIDDLE.
Correct Answer
C. If AGE is greater than or equal to 30 but less than 40.
Explanation
The given correct answer suggests that if the age is greater than or equal to 30 but less than 40, the controls will go to the paragraph named PARA-AGE-MIDDLE. This means that if the age falls within this range, a specific set of instructions or actions will be executed in the PARA-AGE-MIDDLE paragraph.
5.
IF A = 1 OR 2 OR 3 NEXT SENTENCE
ELSE MOVE A TO B.
Correct Answer
C. IF A NOT = 1 AND 2 AND 3 MOVE A TO B.
Explanation
The correct answer is "IF A NOT = 1 AND 2 AND 3 MOVE A TO B." This answer correctly represents the condition where if A is not equal to 1 and is also not equal to 2 and 3, then A should be moved to B. The other options either use incorrect syntax or do not accurately represent the given condition.
6.
Determine the total number of bytes in the following.
01 REC-1.
02 FIRST-GROUP.
03 A1 PIC X(4).
03 A2 PIC 99.
02 B1 REDEFINES FIRST-GROUP.
03 A3 PIC 999.
03 A4 PIC 999.
02 THIRD-GROUP.
03 A5 OCCURS 5 TIMES PIC 99.
Correct Answer
B. 16
Explanation
The correct answer is 16 because there are a total of 16 bytes in the given structure. Each level 01 entry takes up 4 bytes (REC-1 and THIRD-GROUP), each level 02 entry takes up 2 bytes (FIRST-GROUP and B1), and each level 03 entry takes up 2 bytes (A1, A2, A3, A4, and A5). Therefore, the total number of bytes is 4 + 2 + 2 + 2 + 2 + 2 + 2 + 2 = 16.
7.
The association between a filename and corresponding file medium is done in
Correct Answer
C. File-control paragrapH, I-O Section and environment division
Explanation
The correct answer is File-control paragraph, I-O Section and environment division. This is because the association between a filename and corresponding file medium is defined in the File-control paragraph, which is part of the I-O Section in the environment division.
8.
Indicate which one of the following is incorrect
Correct Answer
B. SUBTARCT A FROM D, B FROM E, C FROM F.
Explanation
The correct answer is "SUBTARCT A FROM D, B FROM E, C FROM F." This statement is incorrect because the word "SUBTARCT" is misspelled. The correct spelling is "SUBTRACT."
9.
Which of the following statement is incorrect.
Correct Answer
D. Subscripting enables us to use loops in the procedure division.
Explanation
The given statement is incorrect because subscripting enables us to use loops in the procedure division. Subscripting allows us to refer to any element of a table by the same data name with the facility of identifying the particular element through the values of subscript. It also helps in writing more compact code in the procedure division. Additionally, subscripting does not reduce the number of entries to be included in the data division.
10.
The following is Data Division entry
01 EMP-RECORD.
02 EMP-NAME.
04 FIRST-PART.
05 FIRST-NAME PIC X (10).
05 MIDDLE-NAME PIC X (10).
04 SURNAME PIC X(20).
Correct Answer
A. It is correct.
Explanation
The given answer is correct because the Data Division entry is properly structured according to the COBOL programming language syntax. The EMP-RECORD is defined as a group item with two sub-items, EMP-NAME and SURNAME. EMP-NAME is further divided into two sub-items, FIRST-PART and MIDDLE-NAME, each with a PIC clause specifying the data type and length. The code follows the correct hierarchy and includes all necessary PIC clauses, making the entry correct.
11.
Determine the size of the data item
-9(4). 99
Correct Answer
C. 8
Explanation
The answer 8 refers to the size of the data item -9(4). This indicates that the data item is a signed numeric value with a length of 4 digits, including the sign. The negative sign occupies one digit, leaving 3 digits for the actual numeric value. Therefore, the size of the data item is 8 bytes.
12.
To describe a record the level numbers may be chosen from
Correct Answer
D. 01 to 49
Explanation
The correct answer is "01 to 49." This is because level numbers in COBOL can range from 01 to 49. These level numbers are used to describe the structure and hierarchy of data records in a COBOL program.
13.
The following is a Procedure division statement
READ IN-FILE INTO IN-REC AT END CLOSE IN-FILE STOP RUN.
Where IN-REC is the record-name of IN-FILE. Which one of the following is
Correct?
Correct Answer
D. The AT END path is taken if all the records have been read and the current read encounters the end of file.
Explanation
The statement is correct because the AT END path is taken when all the records have been read and the current read encounters the end of the file.
14.
The Cobol compiler at the time of compilation indicates the error in the following Statement
MULTIPLY 0.1 BY A.
Which of the following had given the correct clause?
Correct Answer
B. A has the PIC CLAUSE ZZZ9.9
Explanation
The correct answer is A has the PIC CLAUSE ZZZ9.9. This is because the MULTIPLY statement is trying to multiply a decimal value (0.1) with a numeric value (A), but A is declared with a picture clause that does not match the expected format. The ZZZ9.9 picture clause allows for a signed numeric value with three digits before the decimal point and one digit after the decimal point. Therefore, the compiler indicates an error because the picture clause of A does not match the expected format for the MULTIPLY statement.
15.
In DATA DIVISION the entries are
01 BILL.
02 A PIC 99.
02 FILLER PIC X(7).
Indicate which one of the following statement in the Procedure division is correct
Correct Answer
C. MOVE ZEROS TO A.
Explanation
In the given DATA DIVISION, the entry "01 BILL" declares a data item named BILL. It has two sub-items: "02 A PIC 99" which is a numeric data item with a length of 2, and "02 FILLER PIC X(7)" which is a character data item with a length of 7.
In the Procedure division, the statement "MOVE ZEROS TO A" is correct. This statement will initialize the numeric data item A to zero. Since A is declared as PIC 99, it can only hold numeric values. Therefore, the statement "MOVE ZEROS TO A" is the correct way to initialize it.
16.
The picture of RAFFLES IS
02 RAFFLES PIC 999V99
What will be the content of raffles when the following data is named to it?
7892^23
Correct Answer
B. 89223
17.
How many number of bytes involved in S9(11) COMP3?
Correct Answer
A. 6 bytes
Explanation
S9(11) COMP3 is a data type in COBOL that represents a signed decimal number with a maximum length of 11 digits. COMP3 uses a packed decimal format, where each digit is stored in half a byte (nibble). Since each byte consists of 2 nibbles, the total number of bytes required can be calculated by dividing the number of digits by 2. In this case, 11 digits divided by 2 equals 5.5 bytes. However, since bytes cannot be divided into halves, the result is rounded up to the nearest whole number, which is 6. Therefore, the correct answer is 6 bytes.
18.
Four data-names VAR-1, VAR-2, VAR-3 and VAR-4 are defined as following
Data-name PIC clause Value Initialized to
VAR-1 999 015
VAR-2 999 005
VAR-3 999 000
VAR-4 999 000
On executing the PROCEDURE DIVISION statement
DIVIDE VAR-1 INTO VAR-2 GIVING VAR-3
REMAINDER VAR-4
these data-names will respectively assume values:
Correct Answer
D. 15, 5, 0, 5
Explanation
The DIVIDE statement divides the value of VAR-1 by the value of VAR-2 and stores the quotient in VAR-3 and the remainder in VAR-4. In this case, VAR-1 is initialized to 015 and VAR-2 is initialized to 005. When VAR-1 is divided by VAR-2, the quotient is 3 and the remainder is 0. Therefore, VAR-3 will have the value 3 and VAR-4 will have the value 0.
19.
Which one out of the following is incorrect?
Correct Answer
D. RENAME clause can regroup a 01, 77, 88 or 66 entry.
20.
EDITED PICTURE ITEMS can not HAVE VALUE CLAUSE.
Correct Answer
A. True
Explanation
The statement is saying that edited picture items cannot have a value clause. This means that when a picture is edited, it cannot have a clause that specifies its value. In other words, the value of an edited picture cannot be determined or specified. Therefore, the correct answer is True.
21.
PERFORM UPDATE-INPUT UNTIL DONE
Irrespective of the context in which it is given, it may be said that
Correct Answer
B. DONE is a condition-name
Explanation
In the given question, it is stated that "DONE is a condition-name." A condition-name is a user-defined identifier in COBOL that represents a condition or a set of conditions. It is used in conditional statements to evaluate whether a condition is true or false. Therefore, in the context of the given question, "DONE" is being referred to as a condition-name.
22.
Consider the following PROCEDRE DIVISION statement:
IF VAR1 LESS THAN VAR2 WRITE REC-1
ELSE WRITE REC-2
If, before executing this statement, VAR1 contains alphanumeric
Literal 'l' and VAR2 contains alphanumeric literal 'A', then
Correct Answer
A. REC-1 is always written
Explanation
The given IF statement checks if VAR1 is less than VAR2. If VAR1 contains the alphanumeric literal 'l' and VAR2 contains the alphanumeric literal 'A', then 'l' is less than 'A' in alphanumeric comparison. Therefore, the condition VAR1 LESS THAN VAR2 is true, and as a result, REC-1 is always written.
23.
The record description of EMPLOYEE-RECORD is given in four different ways below. The only correct choice is:
A)
01 EMPLOYEE-RECORD.
10 EMP-CODE PIC X(6).
10 EMP-NAME PIC X(25).
10 FILLER PIC X(60).
B)
01 EMPLOYEE-RECORD PIC X(91) USAGE COMP.
10 EMP-CODE PIC X(6).
10 EMP-NAME PIC X(25).
10 FILLER PIC X(60).
C)
01 EMPLOYEE-RECORD.
05 EMP-CODE PIC X(6).
10 EMP-NAME PIC X(25).
15 FILLER PIC X(60).
D)
01 EMPLOYEE-RECORD PIC X(91).
10 EMP-CODE PIC X(6).
10 EMP-NAME PIC X(25).
10 FILLER.
Correct Answer
B. A
24.
In order to continue a job after a return code of 12 in step1, what the step2 EXEC statement include?
Correct Answer
B. COND = (12,NE)
Explanation
The correct answer is COND = (12,NE). This means that the job will continue to execute step2 if the return code of step1 is not equal to 12. The "NE" in the COND parameter stands for "not equal", so it ensures that the job will proceed if the return code is anything other than 12.
25.
How can values be passed from the job stream to an executable program?
Correct Answer
A. Through the PARM keyword
Explanation
Values can be passed from the job stream to an executable program through the PARM keyword. The PARM keyword allows for the specification of values that will be passed as parameters to the program. This allows for flexibility and customization in the execution of the program based on the values passed through the job stream.
26.
What parameter directs the output of the job log dataset
Correct Answer
B. MSGCLASS
Explanation
The parameter that directs the output of the job log dataset is MSGCLASS. This parameter specifies the class of messages that are written to the job log dataset. By setting the MSGCLASS parameter, you can control the type of messages that are included in the job log dataset, allowing you to filter and organize the output based on your needs.
27.
If both the JOBLIB & STEPLIB statements are coded in a step, which will be executed?
Correct Answer
B. STEPLIB
Explanation
If both the JOBLIB and STEPLIB statements are coded in a step, the STEPLIB statement will be executed. This is because the STEPLIB statement takes precedence over the JOBLIB statement. The STEPLIB statement is used to specify the libraries that contain the load modules for the program being executed in the step, while the JOBLIB statement is used to specify the libraries that contain the load modules for the entire job. Therefore, the STEPLIB statement is more specific to the current step and will be executed first.
28.
Input file have below record layout.
01 Input-Record.
05 Name PIC X(20).
05 EMP-ID PIC 9(06).
Which is correct verb to exclude specific EMP-ID using SORT job.
Correct Answer
A. OMIT COND
Explanation
The correct verb to exclude specific EMP-ID using SORT job is OMIT COND. This verb is used in the SORT job control statements to exclude records based on specified conditions. It allows the user to specify a condition that, if true, will cause the record to be omitted from the output. In this case, the user can specify a condition to exclude specific EMP-ID values from the output file.
29.
What is COND=EVEN ?
Correct Answer
A. Means execute this step even if any of the previous steps, terminated abnormally.
Explanation
COND=EVEN means that the step should be executed even if any of the previous steps terminated abnormally. This means that regardless of whether the previous steps completed successfully or not, the current step will still be executed. It ensures that the current step is not dependent on the success or failure of the previous steps.