June 1999

Question Paper of CS – 03 File Structure & Programming in COBOL of June 1999 from IGNOU

Time : 2 Hours

Maximum Marks : 60

1 (a) Why are files used in general to perform Input-Output in COBOL? Explain the OPEN, CLOSE, READ and WRITE statements for COBOL.

(b) Why do you need synchronised clause in COBOL? Where do you use this clause? Define the term �slack byte� in this context.

(c) Why do you need INSPECT verb in COBOL? Explain the usage of this verb with the help of examples.

(d) Compare and contrast indexed file organisation with sequential file organisation. Give the examples of situations where sequential file organisation will be preferred over indexed file organisation.

(e) Explain the string handling features of COBOL with the help of examples.

(f) Can you write recursive programs in COBOL? Give reasons. What are the COBOL verbs used for implementing iteration?

2 A view CD library maintains two files as under:

CD-Master File :
CD-Code : 9 digits
CD-Name : 25 characters
No. of times issued : 3 digits
Date of purchase : 8 characters

CD-Transaction File :

CD-Code : 9 digits
Issued to : 25 characters
Date of issue : 8 characters

The library update its master file every week using the transaction file. Each time a CD is issued the count of no. of times issued is incremented by 1. Write a program in COBOL to update the master file from the transaction file. The transaction file initially may be unsorted and may contain more than one entry for a CD.

3 Write a program in COBOL to create an indexed master file from the files given below:

Employee master file :

Employee-code : 5 digits
Employee-name : 25 characters
Date of employment : 8 characters
Basic-Salary : 8 digits

Employee-Attendance-Transaction file

Employee-code : 5 digits
Number of days present : 2 digits

The above two files are used to create an indexed payroll file of the following format :

Key : Employee-code
Total Salary : Calculated as follows :

Total Salary = Basic – Salary � Number of days present

Days in a month

4 (a) Write a program in COBOL which will take a four-digit number from the keyboard and display the number in words on the screen.

(b) XYZ university has 10 students in its ABC programme. To clear this programme each student has to pass five courses. Write a program in COBOL to store the data in memory as an array and declare the results as FAILED or PASSED. (Minimum passing marks are 40%.)

5 Explain the following verbs of COBOL with the help of one example each

(b) ON SIZE ERROR clause
(c) REDEFINE clause
(d) RELEASE and RETURN verbs
(e) SEARCH verbs

Comments are closed.