9.1 Introduction

This chapter illustrates the features of the C/Base Report Writer. While it is not possible to show all of the different combinations of statements, this chapter gives complete examples of how each feature can be used to solve common report problems.

It is assumed that you are familiar with the basics of C/Base RMSfiles and RMS dictionary files (see Chapter 4, Creating RMSfiles for more information). It is also recommended that you refer to Chapter 10, Report Writer Programming Reference.

The Report Writer is a powerful interface to the C/Base Record Management System (RMS). Three files are used in the examples throughout this guide. These files can be found in the demo system and are the same files used as examples in the other chapters.

The files make up a magazine subscription system. The first file, sub, contains subscriber information. The fields in this file are:

subscriber, 16 character string, key

subscriber code

name, 36 character string

subscriber name

address, two 36 character strings

two lines of street address

city, 32 character string

subscriber city

state, 8 character string

subscriber state

zip, 12 character string

subscriber zip code

Subscriber is a unique code assigned to each subscriber by the user. Address is two lines of the subscriber's street address. The other field contents should be obvious from the field name.

The next file, mag, holds information about each magazine. The fields in this file are:

magazine, 16 character string

magazine code

title, 36 character string

magazine title

year_rate, money

rate for one year's subscription

subscribers, integer

number of subscriptions to this magazine

Magazine is a unique code assigned to each magazine and the key field for this file. Title is the title of the magazine being sold. Year_rate is the selling price of the subscription for one year. Subscribers is the total number of subscriptions to this magazine.

The last file, script, contains information about each subscription. The fields in this file are:

subscriber, 16 character string

subscriber code

magazine, 16 character string

magazine code

issues, integer

number of issues left in subscription

started, date

date subscription was started

Subscriber is the code of a valid subscriber in the subscriber file and is the key field for this file. Magazine is the code of a valid magazine in the magazine file. Issues is the number of issues left on this subscription. Started is the date the subscription was started.