NetNews
Due Subscriptions Report

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

DueSubs.Rpt (The report produced by running the program)

Example Input DueSubs.Dat ( The sequential containing the details of all customers whose subscription has fallen due.)

Country.Dat (The sequential file containing the country and exchange rate details)

Exam Practice

If you want to try out the exam under the same conditions as our students you can write the program as the our students do by printing DueSubsOutlineDoc. This is an MS-Word file containing the program outline.

DueSubsDataFiles.Doc contains the input data files and the report produced by running the program.

Don't forget to have the COBOL Metalanguage elements available for reference.

The time allotted for the exam was 2.5 hours.

Major Constructs Sequential Files, Print Files, SORT with Input Procedure, Tables, SEARCH ALL, EVALUATE

Introduction

NetNews is a company which runs an NNTP server carrying the complete USENET news feed with over 15,000 news groups.  Access to this server is available to internet users all over the world.   Users of the system pay a subscription fee for access.   The fee may be paid monthly ($20), half-yearly ($100) or yearly ($180).

A program is required to produce a report showing those subscriptions which are now due. The report will be based on the Due Subscriptions file. 

The Due Subscriptions file is a sequential file sorted on ascending  CardNumber within ascending PaymentMethod.

The report must be printed on ascending CustomerName within ascending  CountryName.

Four items in the report cannot be obtained directly from the Due Subscriptions file;

  • The PaymentMethod field in the Due Subscription file must be converted to its equivalent string value using the following code  assignments :-
           1 = VISA,  2 = Access,  3 = AmExpress, 4 = Cheque.
  • The CountryCode field must be converted to a CountryName
  • The PaymentFrequency field in the Due Subscriptions file must be converted into a SubscriptionCharge using the following assignments;
           1 = $20,  2 = $100, 3 = $180
  • When there is an exchange rate for the country, the SubscriptionCharge must be converted to local currency (SubscriptionCharge * ExchangeRate).

The exchange rates, the country codes and their corresponding country names are contained in a sequential Country file.  The file is ordered on ascending  CountryCode.   To allow efficient conversion of the CountryCode to the CountryName and of the SubscriptionCharge to local currency, the Country file must be loaded into a table in memory.   There are currently 243 country names in the file.

The Country file contains exchange rates for major currencies only.  Where there is no exchange rate for a country there is a zero in the ExchangeRate field. When the exchange rate is 0  a zero must be returned for the local currency subscription charge.


Files

The Country File

The Country File is a sequential file ordered on ascending  CountryCode.   The record descriptions are shown below;  

Field

Type

Length

Value

CountryCode

X

2

Internet Code

CountryName

X

25

-

ExchangeRate

9

10

99999.99999

 

The Due Subscriptions File

The Due Subscriptions file contains details of all customers whose subscription have fallen due.  It is a sequential file sorted on ascending  CardNumber within ascending  PaymentMethod.   Records in the file have the following description:

Field

Type

Length

Value

CustomerSurname

X

20

-

CustomerInitials

X

2

-

PaymentMethod

9

1

1/2/3/4

PaymentFreq

9

1

1/2/3

CardNumber

X

20

-

ExpiryDate

9

4

mmyy

CountryCode

X

2

Internet Code


The Due Subscriptions Report

Numeric values must be printed using comma insertion and either zero suppression or the floating currency symbol. There is no need to worry about controlling the change of page, so no line count need be kept and the headings never have to be printed again.

See the print specification below for more report format details.

Line 2-6     Report Heading.  To be printed on the first page of the report only.
Line 8  Customer Details.  The CountryName is supressed after its first occurrence.
The PayMethod is VISA, Access, AmExpress or Cheque.
Subs is the subscription charge:- $20, $100 or  $180.
LC Subs is the subscription charge in local currency.  This value is rounded to produce a whole number.  Do not precede this value by a dollar sign.  It should be zero suppressed and have commas inserted as appropriate.
Line 15-18  Country totals.  These are the sum of the dollar subscription charges for customers in this country.
Line 32-35          Final Totals. These are the sum of all the customer dollar subscription charges.





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.