Demonstration Database

Overview

Most of the examples in the Data Dictionary topics are based on the simplified order-entry system files contained in the Demonstration Database. A Demonstration Database can be created from the Data Dictionary Editor (_ddedit.utl) with the following steps:

  1. Anywhere in the DD Editor, press <*>. This enables you to call a PRO/5 program.

  2. The <*> keystroke calls a dialog box. Enter the program name mkdemo in this box.

  3. The DD Editor pauses for a few seconds and displays the message:

Initializing demonstration data ...

When the Demonstration Database is created, the four files illustrated in the tables that follow will be present in your currently active database. In addition, the files will be loaded with sample data.

Please note that the alias for each file is listed on the top line of the table for that file. In the tables, all field names, index names, and the names of index segments are also mnemonics that can be used in PRO/5 string template statements. The comments in the tables refer to the various files by their aliases.

Do not create the Demonstration Database if ANY of the following aliases are in your current Data Directory:

  • CUSTOMER

  • ORDER

  • LINE_ITEM

  • ITEM

Do not run mkdemo if any of the following files are in your (DATA) Directory:

cust.dat, order.dat, oline.dat, or item.dat

mkdemoreplaces existing aliases and data files.

Customer File

Customer Master File (Alias = CUSTOMER)

Field Name

Attributes

Comments

cust_num

N(4)

Related to ORDER file. Is a dependent index.

last_name

C(20*)

Is both a dependent index and part of a concatenated index.

first_name

C(15*)

Is part of a concatenated index.

sales_region

C(8*)

Is a dependent index.

address

C(40*)

 

 

address2

C(40*)

 

 

city

C(15*)

 

 

st

C(2*)

 

 

zip

C(8)

 

 

phone

C(15*)

Indices

Index Segments

max_credit

N(10*)

cust_num

cust_num

curr_bal

N(12*)

last_name

last_name

terms

C(10*)

index02

last_name+first_name

 

 

sales_region

sales_region

C and N denote character and numeric data types, respectively.

* Denotes variable length.

Order File

Order Header File (Alias = Order)

Field Name

Attributes

Comments

order_num

N(4)

Related to the LINE_ITEM file and is both a dependent index and part of a concatenated index.

cust_num

N(4*)

Related to the CUSTOMER file and is both a dependent index and part of a concatenated index.

order_date

N(14*)

Julian date. A dependent index.

ship_date

N(14*)

Julian date.

 

pay_date

N(14*)

Julian date

 

ship_method

C(15*)

Indices

Index Segments

 

 

order_num

order_num

 

 

cust_num

cust_num

 

 

index02

cust_num+order_num

 

 

order_date

order_date

C and N denote character and numeric data types, respectively.

* Denotes variable length.

Line_Item File

Order Detail File (Alias = LINE_ITEM)

Field Name

Attributes

Comments

order_num

N(4)

Related to the ORDER file and is both a dependent index and part of a concatenated index.

line_num

N(4)

Is both a dependent index and part of a concatenated index.

item_num

N(4)

Related to the INDEX file and is a dependent index.

price

N(10*)

Indices

Index Segments

qty

N(4)

index0

order_num+line_num

 

 

item_num

item_num

 

 

order_num

order_num

 

 

line_num

line_num

C and N denote character and numeric data types, respectively.

* Denotes variable length.

Item File

Item Master File (Alias = ITEM)

Field Name

Attributes

Comments

item_num

N(4)

Related to the LINE_ITEM file and is a dependent index.

descrip

C(60*)

Is a dependent index.

supplier

C(40*)

Is a dependent index.

cost

N(10*)

Indices

Index Segments

 

 

item_num

item_num

 

 

descrip

descrip

 

 

supplier

supplier

C and N denote character and numeric data types, respectively.

* Denotes variable length.