[TABLE]If you're like many companies your database was really an after thought. Often, the focus was on the application: file maintenance programs, transaction programs, custom reports and so on. You either built a database to support your applications in-house or bought the database as part of an application package. Either solution was expensive.
But what about the database design? In many cases, the database wasn't logically structured or easy to read for user access. You could also have "old" databases left over from the days of DDS and RPG when field names had to be restricted to six characters in length inside a program -- not very useful for users trying to create custom reports and queries.
Options to make data usable
There are many things you can do to create "smarter" databases that save users LOTS of work and provide much better information. Here are two options most companies can't afford:
Option: Use DDS to redefine files
Traditionally, many iSeries shops spend a lot of time re-defining DDS source for files adding column headings, text or alias keywords to provide more meaningful names for fields in your files. Some database reporting tools such as Query/400 will use these enhanced field descriptions, making it easier to read the data when building and running reports.
Is that a good solution? Normally, it's not as good as a data mart. Converting the database is a large issue: compile a new set of files from DDS, recompile your application programs over the new files, extract, transform and load the new files from the old ones.
Option: Create simple data marts for users
Creating a separate data mart offers many advantages:
Creating a data mart is relatively easy on the iSeries. We've created some tools that help automate the process. While the details of building a data mart are beyond the scope of this tip, this i
To continue reading for free, register below or login
To read more you must become a member of Search400.com
');
// -->

s a typical data mart implementation process we've done for customers:
Given the data mart is logically organized and readable, training users on where their data is in the data model should be an easy task now.
SQL views make production data readable
Let's focus on SQL views. They can do more than DDS to make production data easy to read at a lower cost. Using SQL views you can do the following:
While a DDS Join Logical File can do a lot of that, it lacks all the power of an SQL View. SQL Views can be created using complex SQL Select critieria. The SQL views can be accessed for any purpose you need: reporting, data extracts, applications and more.
The nice part about the SQL view is that you don't have replication concurrency data issues. All the data is stored in one table physically. The view, like a more powerful logical file, provides a dynamic, alternate view of the data to the user. I often hear users complain they need access to the "real" data, not a copy. SQL views do this nicely.
Going from DDS to an SQL view
Below is a very simple definition of some fields in a physical file shown using the DSPFFD command. You can see the field names (AVNMID, AVA7CD, AVPZCD) are logically meaningless to a user, making database use difficult.
Display
File Field Description
Input parameters
File . . . . . . . . . . . . . . . . .
. . : BUAVRELW
Library . . . . . . . . . . . . . . . . . : MESCMFIL
File Information
File . . . . . . . . . . . . . . . . .
. . : BUAVRELW
Library . . . . . . . . . . . . . . . . . : MESCMFIL
File location . . . . . . . . . . . . . . . :
*LCL
Externally described . . . . . . . . .
. . : Yes
Number of record formats . . . . . . .
. . : 1
Type of file . . . . . . . . . . . . .
. . : Physical
SQL file type . . . . . . . . . . . . . . . :
TABLE
File creation date . . . . . . . . . .
. . : 09/12/04
Data Field Buffer Buffer Field Column
Field Type Length Length Position Usage Heading
AVNMID ZONED 9 0
9 1 Both AVNMID
Allows the null value
AVA7CD CHAR
2 2 10 Both AVA7CD
Allows the null value
Coded Character Set Identifier . . . .
. : 37
AVPZCD CHAR
2 2 12 Both AVPZCD
Allows the null value
Coded Character Set Identifier . . . .
. : 37