Necessary Preparations [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation
HP ALLBASE/4GL Developer Self-Paced Training Guide
Necessary Preparations
Before you can use the module builder you must first define and create
the field specifications and the order record layout. Then you need to
create the order file.
The order file contains the following fields:
* order_no
* officer_name
* product_no
* quantity
* unit_measure
* cost
* order_date
* delivery_date
Necessary Preparations (Continued)
Defining the Field Specifications.
The product_no field has already been created. However, you will now
need to create the other dictionary field specifications.
To create the field specifications:
1. Create the field specifications for each field listed below.
Only the field entries that differ from the defaults are listed.
a. Order Number. A field for the purchasing order number.
Field Spec. Name order_no
Field Length 5
Edit Code N
Storage Type I
Blank When Zero Y
b. Officer Name. A field for the name of the purchasing
officer who completed the order.
Field Spec. Name officer_name
Field Length 30
Edit Code X
c. Quantity. A six digit number used to specify a quantity of
a product.
Field Spec. Name quantity
Field Length 6
Edit Code N
Storage Type I
Blank When Zero Y
d. Unit of Measure. A four character field indicating the
unit of measure that the quantity is expressed in.
Field Spec. Name unit_measure
Field Length 4
Edit Code X
e. Cost. The cost will be limited to under one billion ($1000
million) dollars, so the field length will be set to 12.
This allows nine figures, a decimal point, and two decimal
places. You specify the two decimal places in the Decimal
Places field.
Field Spec. Name cost
Field Length 12
Edit Code N
Storage Type P
Decimal Places 2
Blank When Zero Y
f. Order Date. The date that the order was placed.
To define a date field specification, you must choose the D
or T edit code. Both are date fields, but the T edit code
defaults to the current date. The order date is usually
going to be the date that the details are entered by the
end user, so, to make the end user's task a little quicker,
the order date will use the T edit code.
Both date fields allow users to enter the date in either
MM/DD/YY format or DD/MM/YY format, depending on the
system- wide date format set by the HP ALLBASE/4GL
administrator.
Field Spec. Name order_date
Field Length 8
Edit Code T
g. Delivery Date. The date that the order was delivered.
This time, you will use the D edit code for the date,
because this field can be left blank until the delivery is
made.
Field Spec. Name delivery_date
Field Length 8
Edit Code D
This completes the definition of the field specifications that are used
in the order file.
Creating the Record Layout.
One record layout is required, named order.
To create the record layout:
1. Create the record header, with a suitable description.
2. Create the record layout as specified below.
Record Layout Name. order
Field Field Spec Name Key # Duplicates
1 order_no 1 N
2 officer_name 2 Y
3 product_no 3 Y
4 quantity
5 unit_measure
6 cost
7 order_date 4 Y
8 delivery_date 5 Y
3. Generate the record layout once you have defined it.
Creating the File Specification.
Now that you have generated the order record layout, you are ready to
create the order file, table, or data set. The details for each data
manager are provided below.
1. Complete the file definition for the data manager you are using.
KSAM Based Applications.
* Define and create the order file, which contains all the order
records.
File Name order
File Type I
External Name ORDER
Default Record 1
Record Layout order
HP ALLBASE/SQL Based Applications.
* Define and create the order table, which contains all the order
records.
File Name order
File Type S
External Name ORDER
SQL DBEfileset ORDRFS
SQL Access Class 1
Record Layout order
HP TurboIMAGE/iX Based Applications.
* Define the order data set, which contains all the order records.
File Name order
File Type D
Database Name traindb
External Name ORDER
Default Record 1
Record Layout order
This data set is a detail data set. It contains the product_no
field, which is an index to the product manual master data set.
This relationship cannot be specified within HP ALLBASE/4GL; it
must be specified in the schema file used to physically create the
database.
In addition, each key defined in the order record layout should be
recorded in an automatic master data set. These may be, but do
not need to be, defined in HP ALLBASE/4GL. The traindb database
created by your administrator already contains the automatic
masters required and defines the link between the order detail
data set and the product manual master data set.
MPE/iX 5.0 Documentation