ADD 40 X TO X.
4 MC MTT cd S
COMPUTE X = 3 * X - 40.
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)
Patni Confidential
What is wrong with the following data declaration?
(Marks - 1)
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
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.
COMPUTE X = A * B - C * D.
COMPUTE X = (A * B) - (C * D).
23 MC MTT cd M
The above two statements are (Marks - 2)
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
Patni Confidential
Let us consider the below mentioned Procedure Division Entry
Study the five expressions and the class to which they belong:
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
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.
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)
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:
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
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.
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.
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
Compile or Run
10 40 None of these 1
time error
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
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).
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
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
Patni Confidential
P1 P2 P3 None of these 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
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.
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
Patni Confidential
1
Patni Confidential
1
Patni Confidential
1
Patni Confidential
2
Patni Confidential
2
Patni Confidential
2
Patni Confidential
5
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