Campus Bookshop
Purchase Requirements Report

Time to complete This is a tough one. Allow 6 hours continuous.
Program Download BookshopRpt91.Cbl is a model answer. Don't look at this until you have made your own attempt at the program.
Example Output

Bookshop.Rpt (The Campus bookshop Lecturer Purchase Requirements Report)

Example Input

In-PReq.Dat and In-Book.Dat and In-Pub.Dat are sequential files that be converted into the following indexed files -

  • The Purchase Requirements File (PRFILE.DAT)
  • The Book File (BOOKFILE.DAT)
  • The Publisher File (PUBFILE.DAT)

using this program.

The conversion program is required because Indexed files are not standard ASCII files and cannot be viewed or edited in a standard text application like Notepad.

Major Constructs Indexed files, Report Writer, Report Section, INITIATE, GENERATE, TERMINATE, READ, WRITE, REWRITE, START

Introduction

Two months before the beginning of each semester the Campus Bookshop produces a Purchase Requirements Report. This report details the books that have to be purchased for the coming semester. In the past this was done manually but now management have decided to computerise the operation.
Accordingly, lecturers' requirements have been captured and the results used to update a Purchase Requirements File. This is a permanent file which contains details of the lecturers' book requirements for both semesters.

You are required to write a program to produce a Purchase Requirements Report from the Publisher, Book and Purchase Requirements files. The report should be sequenced on ascending Publisher Name and should only detail the purchase requirements for the semester under scrutiny. The semester number (1 or 2) should be accepted from the user at the start of the program using a simple ACCEPT and DISPLAY.


File Descriptions

Purchase Requirements File (Indexed)

There is a record for each book title required by a lecturer. Note that a book may be required by more than one lecturer.

Field

KeyType

Type

Length

Value

PR-Number
Primary
9
4
1-9999
Lecturer-Name
Alt with duplicates
X
20
--
Book-Number
Alt with duplicates
9
4
1-9999
Module-Code
--
X
5
--
Copies-Required
--
9
3
1-999
Semester
--
9
1
1/2

 

Book File (Indexed)

Field

KeyType

Type

Length

Value

Book-Number
Primary
9
4
1-9999
Publisher-Number
Alt with duplicates
9
4
1-9999
Book-Title
--
X
30
--

 

Publisher File (Indexed)

Field

KeyType

Type

Length

Value

Publisher-Number
Primary
9
4
1-9999
Publisher-Name
Alt with duplicates
X
20
--
Publisher-Address
--
X
40
--

 

Print Specification

Notes
The report must be produced using the Report Writer.
The Publisher-Name must be suppressed after its first occurrence.
The headings should be printed at the top of each page and the words *** END OF REPORT *** should be printed on line 56 on the last page of the report.
Ordinarily a new page is required after line 50.
The Qty field which is a synonym for Copies-Required should be zero suppressed up to but not including the last digit.
The page number field should also be zero suppressed.



Click to view full version


Copyright Notice

This COBOL project specification is the copyright property of Michael Coughlan. You have permission to use this material for your own personal use but you may not reproduce it in any published work without written permission from the author.