CS-03: FILE STRUCTURE & PROGRAMMING IN COBOL 
JUN 2000

Prepared by: Little Bit Heaven

Time:2 hours 

Max. Marks:60

Note : There are five questions in this paper. Question 1 is compulsory and carries 30 marks. Attempt any three from the rest.

1. (a)  What is the purpose of OCCURS clause in COBOL? Explain with the examples.
How can the information stored using Occurs clause be searched.
(b) How can you implement string find and replace operation in COBOL? Give one example.
(c) What is an equivalent construct for while loop in COBOL? Explain with an example.
(d) What is the need of having different types of file organisation? Give example of
situations where you would like to use the different file organisations allowed in COBOL.
(e) What is the usage of SYNCHRONIZED clause in COBOL? Explain with the help of an example. What is a slack byte in this context?.
(f) Why do you need level 77 and level 88 entries in COBOL? Explain their advantages with the help of examples.
2. Write a program in COBOL for an electricity supply company with the following
requirements:
The company maintains a master file of its customers as
Cust_no                                                 5 numeric digits
Cust_name                                            25 characters
Previous_meter_reading                          5 numeric digits
Cust_address                                        50 characters
Meter_no                                               10 numeric digits
Every month a transaction file is created on the basis of Meter_no as
Meter_no                                                 10 numeric digits
 Meter_reading                                           5 numeric digits
 Assume that bills are produced only if Meter reading has been taken.
 From the above data monthly bills are to be produced for the customers and master data needs to be updated.
Take suitable file organisations for your program. Make suitable assumptions, if any, wherever needed.
3. XYZ University had two libraries-one for staff and one for students. Both these
libraries maintained their books inventory using COBOL file as
Staff_library Master file:
Sorted on Book_accession_no
Book_accession_no                          20 characters
Author                                              20 charecters
Title                                                  20 charecters
Student_library Master File
Sorted on Book_accession_no           20 charecters
Book_accession_no                           20 charecters
Author                                                20 charecters
Title                                                    20 charecters
No-of_books                                      4 digits
The No_of_books field was not kept in Staff_library Master as they had just one copy on the book.  However, the University merged the two libraries to create one library.  Write a program in COBOL to merge the data available on the two files to create a single Library Master File having format same as that of Student_library Master File.  (Please note that some of the books were available in both the libraries.)
4. ABC Stores keeps its inventory using the following file :
ITEM_MASTER :
item_code                5 numeric digits
item_name              25 characters
Quantity_in_Stock    5 numeric digits
Sorted on Item_code
It also maintains a list of suppliers in a supplier file as :
SUPPLIER_MASTER :
Supplier_Id            5 numeric digits
Supplier_name      25 characters
Supplier_address  50 characters
Stored on supplier_Id
Write a program  in COBOL which will update Item_Master file on request of issue of an item.  In case the requested quantity of item is more than in the stock then the next supplier will be issued an order to supply the item.  The next supplier is the next record, in the Supplier_Master, to the supplier to whom last order was placed (Thus, suppliers will be given order one by one).  Please use suitable file organisations and make suitable assumptions, if any. 
5. Explain the following COBOL verbs with one example each :
(a) REDEFINES clause
(b) GOTO DEPENDING verbs
(c) ON SIZE ERROR and ROUNDED options
(d) RELEASE and  RETURN statements
(e) Statements used for Move and Group Move

Hosted by www.Geocities.ws

1