USSR Naval Vessel
Inventory Report

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

USSRSHIP.Rpt (The report generated from the Vessel Master File)

Example Input

UVMF.Dat (The unsorted USSR Vessel Master File) records)

Major Constructs Sequential files, SORT with Input Procedure, Print Files, Pre-defined tables, Condition Names

Introduction

The unsorted USSR Vessel Master File (UVMF) contains details of all the sea-going vessels of the SOVIET UNION. The following is the record description.

Field

Type

Length

Value

Vessel Name

X

9

--

Vessel Type
9
2
01-12
Tonnage
9
6
0-999999
Crew
9
5
0-99999
Location Code
X
1
1/2/3/4/5

A program is required to produce a report detailing the major vessels (Vessels of tonnage 3,500 or greater and all submarines) in each of the following locations;

The Pacific,
The Atlantic
The Mediterranean
The Indian Ocean
The Other Seas

The report must be produced sequenced on ascending Location Code where Location code 1 is the Pacific, code 2 is the Atlantic, code 3 is the Mediterranean, code 4 is the Indian Ocean and code 5 is any Other Seas. Within each location the report must be sequenced on ascending Vessel Type. Each vessel detail line must show the Vessel Name, the Crew size, the Tonnage and the monthly running cost (Crew size * Cost per member).

The cost per crew member is obtained from the following table where the values indicate the running cost in roubles for one month for one crew member;

Monthly Cost Table

L
O
C
A
T
I
O
N
Vessel Type

1

2

3

4

5

6

7

8

9

10

11

12

P

2610

2350

2050

0999

2550

2510

0789

0632

0770

0870

0750

0636

A

2560

2300

0960

0986

2436

2400

0710

0611

0720

0833

0710

0606

M

2400

2010

0960

0860

2200

2386

0670

0550

0700

0800

0685

0596

I

2586

2335

2100

0996

2486

2435

0760

0605

0750

0850

0740

0620

O

2500

2185

0900

0910

2400

2336

0696

0586

0716

0830

0696

0610

The first detail line for each location must also show the Location Name (i.e. Pacific Ocean, Atlantic Ocean, Mediterranean Sea, Indian Ocean, Other Seas) and the first detail line for each Vessel Type must show the Vessel Function. The Vessel Function is obtained from the following table;

Vessel Function Table

Vessel Type Code

Vessel Function
1
Aircraft Carrier
2
Crusier/Battleship
3
Destroyer
4
Frigate
5
Nuclear Submarine
6
Conventional Submarine
7
Assault Ship
8
Supply Ship
9
Corvette
10
Mine Layer/Hunter
11
Fast Attack Craft
12
Coastal Patrol Craft

 

Processing

The program will read the USSR Vessel Master File to produce a new file sorted on ascending Vessel Type within ascending Location Code and containing only submarines and vessels of tonnage 3,500 or greater. The program will then read this new sorted file and use it, and the Vessel Function and Monthly Cost tables, to produce the report.


Report Format

See Printout Specification below and the Example Report.

Line2

To be printed at the top of the report only. No page breaks are required so no page heading, page count or line count is required.
 

Line 5 To be printed at the top of the report only.
 
Line 7 This is a detail line and is to be printed for each vessel in the sorted file.

The Location Name must be suppressed after its first occurrence until a new Location is encountered.

The Vessel Function must also be suppressed after its first occurrence until a new Vessel Type is encountered.

The Tonnage field must be zero suppressed and be broken into thousands by inserting commas in the correct places.

The Crew field must be zero suppressed and broken into thousands by commas.

The Monthly Cost field must have floating Rouble signs (R), up to, but not including, the last digit. It must also be broken into thousands by inserting commas.

 

 


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.