Data Dictionary

 

A data dictionary is a collection of data definitions used by applications to describe and access a database. These definitions do not contain actual data; rather, they comprise standardized "bookkeeping" information about the data (metadata). This includes details on the types, names and structures of all data elements, as well as their interrelationships within the larger context of the database. The primary purpose of a data dictionary is to define the contents of a database so that it can be easily viewed, queried and accessed by an application.

The data dictionary plays a very important role in PxPlus programming and data handling. Once your data has been defined in a PxPlus data dictionary, you will be able to use the powerful tools available in NOMADS to automate the building of Web-based and GUI applications based on this information.

One of these tools is the File Maintenance Generator, which generates Web-based Webster+ HTML pages and/or Windows-based NOMADS panels as file maintenance or inquiry-only panels and/or data entry panels. Another tool is the NOMADS Query Subsystem, which generates panels that display records from datasets and returns a value associated with a record selected by the user. These tools can help to easily create an integrated file maintenance and query system without writing a single line of code.

The data dictionary can be created from an external database (ODB, MySql, Oracle, ADO or DB2). See Using External Databases to Create a Data Dictionary.

PxPlus Data Dictionary

The primary method for building a data dictionary in PxPlus is Data Dictionary Maintenance. It is used to create new files or embed the dictionary information in an existing file. Equivalent programmatic access is also available through a suite of predefined Data Dictionary Objects.

A central repository of data dictionary definitions is maintained in two PxPlus files, providex.ddf and providex.dde:

 

providex.ddf

Defines all the files (or tables) that belong to the database.

 

providex.dde

Defines specific elements (or columns) that exist within these files.

One important feature of the PxPlus data dictionary is that the definitions stored in the repository are also written directly into the corresponding database files. At the most basic level, a data dictionary is used for accessing the data in a database; however, the data dictionary has multiple uses in PxPlus from rapid application development to the conversion of data:

Embedded IOLists

Because the definitions can be saved to the physical files, a separate IOList does not have to be written in programs that use the data. PxPlus accesses the embedded definitions independent of the central data dictionary.

NOMADS

The File Maintenance Generator, Query Subsystem and NOMADS Smart controls use the data dictionary and data class objects.

See NOMADS Development.

(The File Maintenance Generator was added in PxPlus 2019.)

File Maintenance Generator

NOMADS panels and/or Webster+ HTML pages are generated as file maintenance or inquiry-only panels based on data files defined in a data dictionary.

See File Maintenance Generator and Webster+.

Query Subsystem

The element and key information from the data dictionary can be used to create query definitions.

See Query Subsystem.

Smart Controls

Smart controls provide developers with the ability to make self-loading controls to display and select the contents of data files or database tables.

See Smart Controls.

Views

The Views System can employ the data dictionary's embedded definitions to generate end-user Views of the data.

See Views System.

Report Writer

The Report Writer can access files with embedded dictionaries, as well as PxPlus Views, to design and generate graphical reports.

See Report Writer.

PxPlus SQL ODBC Driver

The data dictionary is fully compatible with the PxPlus SQL ODBC Driver. The Driver simply reads the embedded IOList to determine the fields and format of the database file. Otherwise, when the data dictionary is not present, a manually written INI file would have to be created for each file in order to access the data.

See PxPlus SQL ODBC Driver.

Supported File Types

The PxPlus data dictionary is designed to support normalized files - files in which all records have the same record layout. The Update File process in Data Dictionary Maintenance uses the PxPlus KEYED directive to create all physical files. A key is a string of characters used to identify the records in a file.

Three keyed file formats are available for data dictionary utilities: FLR (Fixed Length Records), VLR (Variable Length Records), and EFF (Enhanced File Format). See EFF vs. VLR File Formats.

Data dictionary support for multiple-format files, such as those with header and detail records, is limited to variant records. The ability to define non-normalized data files is provided only within the data dictionary, not within PxPlus itself or within the NOMADS File Maintenance or Query generation facilities. Variant records are supported primarily for the creation of INI files and SQL database definitions when migrating applications. See the INI File Generation and SQL Create Table utilities.

Creating a Data Dictionary Definition

Each of your data files can be defined by using Data Dictionary Maintenance. Once all the pertinent information is entered, the individual data dictionary information is embedded into the file, as well as written to the definition files, providex.ddf and providex.dde.

In addition, the data dictionary can be created from an external database (ODB, MySql, Oracle, ADO or DB2). See Using External Databases to Create a Data Dictionary.

To set up a data dictionary definition for a file, the four steps are:

Step

Description

1. Identify the database file

Enter information to describe the physical file, including pathname, group, file type and block size. See Info tab.

2. Define the elements

Enter information for defining the elements in the physical file (e.g. variable name, type, length, format, delimiter, etc.). See Elements tab.

3. Define the keys

Define the primary and alternate keys for the physical file. See Defining Keys.

4. Embed the updated definition into the physical file

Embed the current definition into the physical file. Depending on the contents of the current definition, PxPlus will determine how to update the physical file with the current definition. See Updating the Data Dictionary.

Note:
Be aware that all changes made to the definition (table) currently loaded in Data Dictionary Maintenance are written immediately to the providex.ddf and providex.dde files as they are entered.

Using External Databases to Create a Data Dictionary

The data dictionary can also be created from an external database (ODB, MySql, Oracle, ADO or DB2). The Database Import Utility can be used to define the data dictionary and create database Prefix or Link files or PxPlus native files.

By using Prefix or Link files, PxPlus development application tools are available to interact and connect with the external database. These tools include the Query Subsystem, the Report Writer, the Views System, and the File Maintenance Generator for quickly creating Web-based (Webster+) and Windows-based (NOMADS) file maintenance and data entry screens, report interfaces, etc.

Other PxPlus tools, such as the Bulk Edit Data Elements utility and File Link Maintenance, can be used to build and quickly refine the data dictionary and create interrelationships between files.

Database export utilities, such as the PxPlus Bulk Database Export Utility, can be used to add and load tables in an existing database (ODB, MySql, Oracle, ADO or DB2) by using PxPlus native files.

See Also

Using the Data Dictionary
Data Dictionary Maintenance
Data Dictionary Utilities
Data Classes
Bulk Edit Data Elements