The ACME
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Time to complete | This is a tough one. Allow 6 hours continuous. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Program Download |
ACME99.Cbl is a model answer. Don't look at this until you have made your own attempt at the program. The main program (ACME99.cbl) calls the PostageRate.Cbl program.. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example Output |
DataFiles.Doc (A word file showing the contents of the Orders file after running the program and of the Stock and Manufacturer files both before and after running the program.) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example Input |
InStk.Dat and In-Manf.Dat are sequential files that must be converted into the relative Stock File (Stock.Dat) and the indexed Manufacturer File (Manf.Dat) by using the Seq2Direct.Cbl program. The conversion program is required because direct access files are not standard ASCII files and cannot be viewed or edited in a standard text application like Notepad. To view the contents of the Stock and Manufacturer files they must first be converted into sequential files using the Direct2Seq.Cbl program. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Major Constructs | Indexed files, Relative Files, SubPrograms, CALL..USING, READ, WRITE, REWRITE, Condition Names (level 88s), EVALUATE, UNSTRING, MULTIPLY..ON SIZE ERROR. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IntroductionAcme Manufacturing Plc. manufactures a range of cheap catering equipment
for the European market. Some of the parts used are fabricated within
the company, but most are standard units purchased from a range of companies
in Europe and Ireland. General DescriptionA program is required which will process the Stock file and Manufacturer file to create an Orders file containing ordering information for all the parts that need to be re-ordered (i.e. where the QtyInStock is less than the ReorderLevel). For each stock item that needs to be re-ordered the program will create a record in the Orders file and will set an ONORDER flag in the Stock file to show that the item has been ordered. Acme Manufacturing tries to pay all suppliers in EU countries in advance. For these countries, the COSTOFITEMS and POSTAGE fields of each Orders file record must be calculated. With the exception of the Republic of Ireland, postage rates for all EU countries are the same. The postage rates are obtained by calling a program "PostageRate" with two parameters; the POSTNUMBER (In) and the POSTCHARGE (In/Out). The POSTNUMBER is derived, as shown by the decision table below. The POSTCHARGE is the value returned (in Euro and Cent :- max €99.99) by "PostageRate" for a particular POSTNUMBER. Note, that if the total weight of the items ordered is greater than 50kg then the items cannot be sent by post and the POSTAGE must be set to €0.00.
|
Field |
Type |
Length |
Values |
ItemDescription |
X |
30 |
-- |
ManfName |
X |
30 |
-- |
QtyRequired |
9 |
6 |
1 - 999999 |
CostOfItems |
9 |
7 |
0.00 - 99999.99 |
Postage |
9 |
4 |
0.00 - 99.99 |
The last two items are 0 for all non EU countries.
The QtyRequired is obtained
from the ReorderQty field
in the Stock File.
The CostOfItems is the QtyRequired
multiplied by the ItemCost.
Stock File (Relative)
Field |
Type |
Length |
Values |
StockNumber |
9 |
5 |
10001 - 99999 |
ManfCode |
X |
4 |
aaaa- zzzz |
ItemDescription |
X |
30 |
-- |
QtyInStock |
9 |
6 |
1 - 999999 |
ReorderLevel |
9 |
3 |
1 - 999 |
ReorderQty |
9 |
6 |
1 - 999999 |
ItemCost |
9 |
5 |
0.00- 999.99 |
ItemWeight |
9 |
5 |
1g- 99999g |
OnOrder |
X |
1 |
y/n |
Note: The relative record key is obtained by subtracting 10000 from the StockNumber.
Manufacturer File (Indexed)
Field |
Key |
Type |
Length |
Values |
ManfCode |
Primary |
X |
4 |
AAAA -ZZZZ |
ManfName |
ALT with Duplicates |
X |
30 |
- |
ManfAddress |
- |
X |
70 |
- |
Note.
The constituent parts of the address are separated by commas, with the country name coming last.
The country name for Ireland and Northern Ireland is always Ireland even though, for postage charge purposes, Northern Ireland is treated as an Other EU country.
The second last item in an Irish address is the county name. This allows
us to distinguish Northern Ireland addresses from those in the Republic.
e.g. SMALL PARTS LTD.,15 SHORE ROAD,BALLYMENA,ANTRIM,IRELAND
Each constituent part of the address will immediately follow its preceding comma.
Addresses are always in upper case.
EU countries
Austria, Belgium, Denmark, England, Finland, France, Germany, Greece,
Ireland, Italy, Luxembourg, Portugal, Scotland, Spain, Sweden, Wales.
Northern Ireland counties
Antrim, Armagh, Derry, Down, Fermanagh, Tyrone.
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.