Exercise 5:Defining the Data Access [ HP ALLBASE/BRW Tutorial ] MPE/iX 5.0 Documentation
HP ALLBASE/BRW Tutorial
Exercise 5:Defining the Data Access
This exercise describes the BRW final access table, what source tables
are, and shows you how to project items from the source tables into your
report. This section takes 20 minutes.
Defining a Table
For this report, you want to define your own tables.
Define a table
1. At the Define Report screen, choose Define Table.
The Define Table screen appears.
You use this screen to tell BRW where to find the data to be used
in your report. The data can come from several sources, including
IMAGE tables, MPE or KSAM files, or ALLBASE/SQL tables. For this
tutorial, use the CUSTOMERS source table in the IMAGE database
TOYDB.
2. Type a table name in the Table field.
CUSTREP1-DATA
This table name refers only to the table definition for this
report. It does not refer to an actual file name.
3. Press Tab twice to skip the Type field. You accept the default J
for a join type.
4. Type the source table name in the Source Table field.
CUSTOMERS
The source table name is the actual name for an IMAGE data set in
the TOYDB database. For other reports, you can use the file
format name of an MPE or KSAM file (from the data dictionary), the
name of another BRW table (already defined in the same report) or
the name of a data set (as we have done here). If this were an
SQL table, you would use the format owner.name for the table.
5. Type TOYDB.PUB in the Location field.
If you did not sign on to the ITF3000 account, or if the TOYDB
database does not reside in the account where you signed on,
you need to type the account name as well. For example,
TOYDB.PUB.ITF3000. If your database administrator or system
manager has moved the TOYDB database to some other group and
account, type the correct location.
6. Look at the Password field. The TOYDB database does not have a
password so you can skip this field.
7. Press Enter or choose Add Table.
Make Sure You Can Use All the Items
Look at the available items
1. Choose other keys. BRW displays the following function labels:
2. Choose Project Items to go to the Project Items screen.
3. Look at the items listed on this screen.
All the items in the table are listed in alphabetical order. Each
row of the source table CUSTOMERS contains a value for every item
listed here. The number of rows in the final access table depends
on the number of records used from the CUSTOMERS data set when the
report is run. Items that you can use in the report have an X in
the Project field. If you blank out the X, you cannot use the
item. All the items that you need for this report--CUSTOMER-NAME,
CUSTOMER-NO, SALES-AREA, and TURNOVER-MTD--have an X in the
Project field and so can be used in the report.
4. Accept the default of all Xs to project all the items.
You could blank out unwanted items, perhaps for security reasons,
but there is no need to do so here.
5. Look at the Alias Name field. You could give items different
names in the report by typing a new name in the Alias Name field.
For this report, do not use alias names.
6. Look at the NumPrec field. This field is used to set the numeric
precision for numeric items. You do not need to set numeric
precision for this report.
7. If you want more information about this screen or the fields,
choose Help and then return to this screen by choosing Exit
Help.
8. When you are finished looking at this screen, choose Exit to
return to the Define Table screen.
9. Press Exit again to return to the Define Report screen.
Notice that there is now an entry, CUSTREP1-DATA, in the Final Access
Table field. This means that the table you just defined, CUSTREP1-DATA,
is the final table used for this report.
MPE/iX 5.0 Documentation