| 1. |
(a). |
Compare and contrast
the Indexed file organisation with the Relative file organisation.
Suggest the types of applications where Relative file organisation
will be preferred over Indexed file organisation. |
|
(b). |
How do you
implement iteration in COBOL ? Give two examples. Can you write
recursive program in COBOL ? Justify your answer.
|
|
(c). |
How can you sort
the values stored in a single dimensional array in COBOL? Explain
with the help of an example. |
|
(d). |
What is the purpose
of INSPECT statement in COBOL? Explain with the help of examples.
|
|
(e). |
Compare and contrast
the MOVE and Group MOVE statement of COBOL, with the help of
examples. |
|
(f). |
Why do we files to
perform Input-Output to COBOL program ? Explain various Input-Output
statements of COBOL with the help of one example each.
|
| 2. |
|
The Sugar Exporter Co-operative works in a
distributed environment, as they are associated with a number of
plants situated all across India. On receiving an export order, the
Co-operative distributes the order to some of its plants. Assume
that there are only three plants and that all these plants keep
records of their production in COBOL in the following format
: |
|
|
| Sugar Quality |
2 digits |
| Quantity |
5 numeric digits
|
| Export Order No. |
6 alphabets
|
| Order Date |
8 digits |
| Date of Completion of Order |
8 digits
|
|
|
|
Write a program in
COBOL which merges the data from these three plants to one single
master file. |
|
|
please notice :
(i). The files received
from the plants are sorted on the field "Date of Completion of
Order". (ii). The master file (which is to be generated )
is sorted on the field "Order Date". (iii). The date
of completion of order in the single master file will be the highest
of the date of completion received from plants.
|
| 3. |
|
ABC Bank keeps
accounts of its customer using a COBOL program. The structure of
their master file is : |
|
|
| Account
Type
|
2 characters |
| Account Number |
5 numeric digits
|
| Name |
25 characters |
| Address |
50 characters |
| Balance |
6 characters
|
| Last withdrawn on |
8
digits. | |
|
|
This master file is used
for daily transactions of the customers. Every time a customer
withdraws money his master should be updated. Write a program in
COBOL for updating the master file on customer withdrawals on-line.
Indicate the file organisation you have chosen. Give reasons for
doing so. |
| 4. |
|
Explain the
following COBOL statements/verbs/clauses giving one example for each
: |
|
|
(i). LABEL RECORDS(S)
(ii).
REDEFINES (iii). STRING (iv).
SUBSTRACT with ROUNDED and ON SIZE ERROR options
(v).
OCCURS |
| 5. |
(a). |
Write a
program in COBOL for printing Fahrenheit equivalent of Celsius
temperature in the range of 0 to 1500 F at 100 interval. The
conversion formula to be used is : |
|
|
0 Celsius = 5/9 (0
Fahrenheit -- 32) |
|
(b). |
Identify the
error/errors, if any, in the following COBOL statements. Give
reasons. |
|
|
(i). PERFORM PARA_X
UNTIL CTR=8
PARA_X ADD X
TO Y. ADD 1
TO CTR. IF CTR = 8 STOP
RUN
(ii). IF A = 5 OR IF A = 8
PERFORM.PARA_II
END_IF.
(iii) ADD X, Y, Z GIVING
A ROUNDED ON
SIZE ERROR MOVE BLANK TO C.
(iv). MOVE AMT1 TO
1000.
MOVE 'ABC', AMT2 TO AMT3
(v). PERFORM PARA_Z THRU
PARAC
VARYING X1 FROM 1 UNTIL X1 < 100.
PARA_Z
PARAC
|