Anda di halaman 1dari 34

Que

Qstn Sub stio Com


No Typ Topi n plex Question
e c Cate ity
gory

Consider two data items

01 W-A PIC 9(3)V99 VALUE 23.75


01 W-B PIC ZZ9V99

MOVE 123.45 TO W-B


1 MC MTT cd s
MOVE W-A TO W-B

What will be W-B value after the execution above statement?


(Marks - 1)

Which of the following can be used as a check protection


symbol (Marks - 1)
2 MC MTT cn S

What is the result of the following?

3 MC MTT cn S DIVIDE A INTO B GIVING C. (Marks - 1)

Consider the following COBOL entries

05 X PIC 99 VALUE 10.

ADD 40 X TO X.
4 MC MTT cd S
COMPUTE X = 3 * X - 40.

The result in X is (Marks - 1)

ZEROES and SPACES are _______ constants (Marks - 1)


5 MC MTT cn S

Patni Confidential
The sequence in which operations are performed in a Compute
statement is (i)* or /
(whichever appears first from left to right) (ii) **
(iii) + or
6 MC MTT cn S
-(whichever appears from left to right)
(Marks - 1)

A READ statement is executed on the indexed file randomly


and the respective record was
not found inside the file. What would be the value of file
7 MC MTT cn S
status variable? (Marks - 1)

Consider the following COBOL entries:

05 X PIC 99 VALUE 10.

8 MC MTT cd S SUBTRACT 20 FROM X.

The resultant value of X will be (Marks - 1)

Identify the invalid data name from the following (b indicates


spaces): (Marks - 1)
9 MR MTT cn S

OCCURS clause is used in the DATA DIVISION on data names at


(Marks - 1)
10 MC MTT cn S

There is a file whose ORGANIZATION is INDEXED. You want to


read the records from the file in
RANDOM fashion as well as sequentially. Then which of the
11 MC MTT cn S access mode would you specify?
(Marks - 1)

Patni Confidential
What is wrong with the following data declaration?
(Marks - 1)

01 W-DATE PIC X(6).


12 MC MTT cd S 05 DD PIC 99.
05 MM PIC 99.
05 YY PIC 99.

The following combination of edit characters can appear in


the same PIC clause Except
13 MC MTT cn S (Marks - 1)

It is the only hardware-dependent division of a COBOL.


(Marks - 1)
14 MC MTT cn S

15 MC MTT cn S Identify the correct statements.

16 MC MTT cn S Rename clause is always signaled at level Number____

Find which of the combination is not permissible


(Marks - 1)
17 MC MTT cn S

i). The numeric data item described with COMP-2 must not
contain the PIC description.
(ii) If a sequential file is opened in I-O mode, then we cannot
delete records.
18 MC MTT cn S
Which of the above statements are incorrect? (Marks - 1)

Patni Confidential
Determine the bytes required for the data items of PIC 99999
COMP-3. (Marks - 1)
19 MC MTT cn S

While updating existing indexed record if access mode is


20 MC MTT cd S sequential read statement
precedes _____________

The following entries appear in the WORKING-STORAGE


SECTION: (Marks - 2)

01 DATE-TODAY.
05 YY PIC XX VALUE "90".
05 MM PIC XX VALUE "12".
21 MC MTT cd M 05 DD PIC XX VALUE 31.

01 DATE-EDIT PIC XX/XX/XX.

MOVE DATE-TODAY TO DATE-EDIT.

Consider the following PROCEDURE DIVISION entry

OPEN EXTEND IN-FILE


22 MC MTT cn M
Identify the correct statement (Marks - 2)

COMPUTE X = A * B - C * D.
COMPUTE X = (A * B) - (C * D).
23 MC MTT cd M
The above two statements are (Marks - 2)

Consider the following:

01 A PIC 9(10)
01 B PIC 9(10)
24 MC MTT cd M 01 C PIC 9(19)

MULTIPLY A BY B GIVING C

Which of the following is true?

Patni Confidential
Let us consider the below mentioned Procedure Division Entry

IF A < B AND C > D


GO TO P1
ELSE IF NOT ( A > B OR B < C)
GO TO P2
ELSE GO TO P3.
25 MC MTT cd M
In this A = 6, B = 7, C=5 and D= 8, Indicate the Para name to
which the control will be
transformed if before execution of the above if sentence
(Marks - 2)

Study the five expressions and the class to which they belong:

I. SPACES Figurative constant


II. Depreciation Schedule Non-numeric literal
III. "12%" Non-numeric literal
26 MC MTT cd M IV. INTEREST-DUE Non-numeric literal
V. ZEROES Figurative constant

Which of the following statement is true? (Marks - 2)

Consider the following piece of code

01 GROSS-PAY
05 BASIC-PAY PIC 9(5)
05 ALLOWANCES PIC 9(3)
27 MC MTT cd M
If BASIC-PAY has a value 1000 and ALLOWANCES has a value of
250, what will be displayed by the statement DISPLAY GROSS-
PAY (Marks - 2)

Patni Confidential
Observe the following code

If Amt1 = Amt2
NEXT SENTENCE
28 MC MTT cd M Else
Add 1 to Total

What will be the output of the prorgam?

Study the following code snippet

01 A PIC 99V9 VALUE 5


01 B PIC 9V9 VALUE 6
01 C PIC 99V9 VALUE 2.5
01 D PIC 99 VALUE 3
29 MC MTT cd M
COMPUTE A ROUNDED B C = A+B*C/D
ON SIZE ERROR PERFORM PRINT-ERROR

The values of A, B and C after execution of the above


statement are (Marks - 2)

Let us consider the following portion of procedure division

MOVE 0 TO A,B

PARA1.
ADD 3 TO A.
30 MC MTT cd M ADD 2 TO B.
IF B < 11 THEN GO TO PARA1.
DISPLAY THE VALUE OF A = A.

What is the output of A? (Marks - 2)

Patni Confidential
Consider the following DATA DIVISION entries:

01 TABLE.
05 FACULTY OCCURS 3 TIMES INDEXED BY F1.
10 DEPARTMENT PIC X(10) OCCURS 6 TIMES INDEXED BY D1.
31 MR MTT cd M
Which of the following statements are not true considering
the above code? (Marks - 2)

Which of the following rules are false regarding the String


32 MC MTT cd M
Statement

Refer to below code:-

01 A PIC 9V9 VALUE 9.5


01 B PIC 9 VALUE 9.
01 C PIC V9 VALUE 0.8
01 D PIC 9
01 E PIC 9
33 MC MTT cd C 01 F PIC 9V999

What are the contents of D E and F after the code is


executed:

COMPUTE F ROUNDED=A+C/B
MULTIPLY A BY C GIVING E
ADD B C A GIVING D ROUNDED

Patni Confidential
Consider the following DATA DIVISION entries:

01 TALLY-1 PIC 9 VALUE IS 2.


01 MY-STRING PIC X(20).

MOVE bbBACDABCZPABCABCPQ. TO MY-STRING.

34 MC MTT cd C INSPECT MY-STRING TALLYING TALLY-1 FOR ALL ABC


BEFORE INTIAL . AFTER INTIAL Z

What will be the value of TALLY-1 after execution of the above


statement? (Assume b as spaces)
(Marks - 5)

Study the data descriptions and answer the questions given


below
I.
01 ORDER-RECORD
05 OUT-HEADER PIC X(50)
05 ITEM-COUNT PIC 99
05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING ON ITEM-
COUNT
II.
01 NAME-AND-ADDRESS
05 N-AND-A-LINE OCCURS 5
05 LINE-LENGTH PIC 99
05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON LINE-
LENGTH
35 MC MTT cd C
III.
01 SALES-LIST
05 SALESMAN-COUNT PIC 99
05 SALES PIC 9(6) OCCURS 1 TO 100 DEPENDING OF SALESMAN-
COUNT
IV.
01 ORDER-RECORD
05 NO-OF-BRANDS PIC 99
05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON NO-
OF-BRANDS

Which of the following is true? (Marks - 5)

Patni Confidential
What is the size of W-REC in the following (Marks - 5)

01 W-REC
05 A PIC 9(4)V99
05 B REDEFINES A
10 C PIC XX
10 D PIC S9(4)
36 MC MTT cd C 05 E OCCURS 7 PIC ZZ.ZZ
05 F OCCURS 5
10 G PIC ZZ.ZZZ99
10 H OCCURS 3
15 J PIC 9(3)
15 K PIC V99

Given the following SEARCH statement, select the option.


(Marks - 5)

SEARCH ALL ITEM-PRICE-TABLE


AT END PERFORM 9000-ERR
37 MC MTT cd C
WHEN WS-ITEM-PRICE (X1) < IN-PRICE
COMPUTE WS-WEIGHT = WS-ITEM-WT (X1) * IN-QTY
END-SEARCH

Patni Confidential
Examine the following code. Assume an indexed file is opened
successfully in I-O mode. (Marks - 5)
MAST-EMP-NO is the primary key.

MOVE 1122 TO MAST-EMP-NO.


READ MASTER-FILE INVALID KEY MOVE N WS-REC-
SW.
IF WS-REC-SW NOT = N
PERFORM 4000-UPDATE.
38 MC MTT cd C STOP RUN.
4000-UPDATE.
MOVE WS-NEW-ADDR TO MAST-EMP-ADDR.
MOVE WS-NEW-SAL TO MAST-EMP-SAL.
MOVE 1123 TO MAST-EMP-NO.
REWRITE MAST-EMP-REC INVALID KEY DISPLAY
REWRITE ERROR.

Emp-File is indexed on EMP-NO with PIC X(05) ) and the


alternate-key is EMP-DEPT-NO
with Duplicates as PIC X(03). There are 5 employee-records in
the department D01.
We want to retrieve employee-records from the department
D01. Assume that the
Emp-File is opened in I-O mode and access mode is dynamic.
39 MC MTT cd C
MOVE D01 TO EMP-DEPT-NO.
START EMP-FILE INVALID KAY
DISPLAY START FAIL GO TO EXIT-
PARA.
READ EMP-FILE NEXT RECORD AT END .
(Marks - 5)

Patni Confidential
Go through the code given below

..
DATA DIVISION
.
FILE-CONTROL.
SELECT EMPFILE ASSIGN TO 'EMPFILE'
ORGANIZATION IS SEQUENTIAL
ACCESS IS RANDOM
RECORD KEY IS EMPNO.
40 MC MTT cd C
PROCEDURE DIVISION.

DELETE EMPFILE
INVALID KEY
DISPLAY ERROR DELETING RECORD.

Which of the statements are valid? (Marks - 5)

Patni Confidential
Answ
Choice 0 Choice 1 Choice 2 Choice 3 Choice 4 Choice 5
er

b2375 (where b
12375 02375 invalid move 1
indicates space)

All the
Z * + 0,1,2 1
above

The remainder of The remainder of


C=A/B C=B/A 2
B/A is stored in C A/B is stored in C

Compile or Run
10 40 None of these 1
time error

Figurative Numeric Non-numeric Alphabet 0

Patni Confidential
i,ii,iii iii,I,ii ii,I,iii iii,ii,i 2

22 24 23 39 2

compile-time none of
10 00 -10 0
error these

ANNUAL-
SAVINGS-
ALLOCATION-FOR- SAMOUNT250 12bDEMAND 1,3
ACCOUNT
OVERHEAD-COST

Any level from 02


01 level 77 level 88 level 3
to 49

ACCESS MODE has


SEQUENTIAL RANDOM DYNAMIC nothing to do with 2
it

Patni Confidential
Under W-DATE all
level 05 items are PIC cant be DD, MM, and YY
Nothing is wrong. having a PIC 99 specified for a are invalid
2
but level group item. datanames.
01 has PIC X(6).

$9v9 $99.99DB ZZ9.99CR 99V.99 3

Identification Environment Procedure


Data Division 1
Division Division Division.

When $ sign
If we want to
appears in all
have both $ float
If all the digits positions and
and + or sign Zs can appear
before and after value is zero the
representation before as well as
the decimal point effect is to blank
then we write after the decimal 0,2,3
are zero the the
the + or to point
resulting field will entire field
the left of the
be blank (including any .
field
and ,)

77 66 1 4 1

Organization IS
Organization is Organization IS Organization is NONE OF
SEQUENTIAL
INDEXED ACCESS DYNAMIC ACCESS INDEXED ACCESS THE 1
ACCESS IS
IS SEQUENTIAL IS SEQUENTIAL IS DYANMIC ABOVE
DYNAMIC

Only (i) Both (i) & (ii) Only (ii) None of the above 3

Patni Confidential
Pic description is None of
4 3 2 1
not correct the above

Rewrite
Write Statement Invalid Key Delete statement 0
Statement

901231 90/12/31 31/12/90 311290 0

Organization of Organization of
Organization of Organization of
IN-FILE is IN-FILE is
IN-FILE is indexed IN-FILE is indexed
sequential and sequential and
and records can and records can 1
records can be records can be
be appended at be appended in
appended in the appended in the
the beginning the end
beginning end

Will give some Will give the same Syntactically Will generate an
1
different output results wrong error

The execution of The definition of


The execution of Program will be
the above may C is invalid
the above will not executed 2
result in size resulting in
result size error. successfully
error. compilation error.

Patni Confidential
P1 P2 P3 None of these 1

I and III are I and IV are III and IV are


All are correct 3
incorrect incorrect incorrect

1250 01000250 01250 1.250 1

Patni Confidential
No operation
performed if
If Amt1=Amt2
Amt1 = Amt2,
If Amt1=Amt2 1 If Amt1=Amt2 Else program
program
will be added to clause will not be continues with 2
continues with
Total executed statement before
statement after
endif.
End-If

None of
A=10 B=0 C=10 A=10 B=9.9 C=9.9 A=10 B=0 C=9.9 A=10 B=6 C=10 3
the above

None of
15 12 18 21 2
the above

Patni Confidential
The F1 must be Before accessing
declared by the The PIC clause the elements of
programmer in can not specify the above table All the above 0,2
the DATA with OCCURS the F1 should be
DIVISION. initialized to 1.

Identifier
Receiving field
specified with the When size option
All literals must must be an
pointer clause is specified entire
be described as elementary data 0,3
must be an receiving field is
numeric item with no
elementary transmitted
editing symbols
numeric item

F=9.589 E=8 D=1 F=9.589 E=8 D=9 F=9.589 E=7 D=9 F=9.589 E=7 D=1 2

Patni Confidential
3 4 5 6 1

I and III are not


I and III are valid I and IV are valid All are valid 0
valid

Patni Confidential
177 161 180 None of the above 3

The syntax is
This is a valid This is an invalid correct but it will None of the
1
statement. statement. give wrong result. above.

Patni Confidential
An INVALID KEY
The REWRITE All modifications All specified None of
will occur on the
statement will be will not happen. fields will not be the 1
REWRITE
successful. modified above.
statement.

The program will The program will


read the first The program will read the second
employee-record display START employee-record None of the
1
from the FAIL error from the above.
department message. department
D01. D01.

Patni Confidential
The above code is The above code is The above code
syntactically syntactically has more than 2 Unpredictable 0
incorrect correct errors.

Patni Confidential
Marks

Complexity is for 2 marks

Patni Confidential
1

Patni Confidential
1

Patni Confidential
1

Patni Confidential
2

Patni Confidential
2

Patni Confidential
2

Patni Confidential
5

Change the option

Patni Confidential
5

Patni Confidential
5

Patni Confidential
5

Patni Confidential
Question No Errors
Q11 Organization it is z and not s
33 Refer to below code Given the following:
33 code is executed
36 What W is Capital

Changes to be made as on 22nd Nov 2010.


Q20 Option 1 Rewrite Statement
Q23 Option changed for all 0,1,2,3
Q24 Options are changed
Q34 Option 3 is changed
Q6 Question Changed
Q17 IS is capital
q22 added changed to appended in all options
Q28 Changed the question

Anda mungkin juga menyukai