# Data Dictionary

> Source: https://manual.pvxplus.com/data-dictionary/introduction

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 graphical user interface applications based on this information.

One of these tools is the **[File Maintenance Generator](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/fmgen/fmgen-introduction)**, which generates Web-based **[Webster+ HTML](https://manual.pvxplus.com/webster/webster)** pages and/or Windows-based **[NOMADS](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/getting-started)** panels as file ***maintenance*** or ***inquiry-only*** panels and/or data entry panels. Another tool is the NOMADS **[Query Subsystem](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview)**, 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, OCI, ADO or DB2). See **[Using External Databases to Create a Data Dictionary](https://manual.pvxplus.com/data-dictionary/introduction#external_db)**.

## PxPlus Data Dictionary

The primary method for building a data dictionary in PxPlus is [Data Dictionary Maintenance](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/overview). 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](https://manual.pvxplus.com/data-dictionary/data-dictionary-objects/overview)**.

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.<br>See **[NOMADS Development](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/getting-started)**.<br>*(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.<br>See **[File Maintenance Generator](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/fmgen/fmgen-introduction)** and **[Webster+](https://manual.pvxplus.com/webster/webster)**. |
| ***Query Subsystem*** | The element and key information from the data dictionary can be used to create query definitions.<br>See **[Query Subsystem](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview)**. |
| ***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.<br>See **[Smart Controls](https://manual.pvxplus.com/nomads-graphical-application/smart-controls/overview)**. |
| ***Views*** | The Views System can employ the data dictionary's embedded definitions to generate end-user Views of the data.<br>See **[Views System](https://manual.pvxplus.com/views-system/introduction)**. |
| ***Report Writer*** | The Report Writer can access files with embedded dictionaries, as well as PxPlus Views, to design and generate graphical reports.<br>See **[Report Writer](https://manual.pvxplus.com/report-writer/introduction)**. |
| ***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.<br>See **[PxPlus SQL ODBC Driver](https://manual.pvxplus.com/odbc/pxplus-odbc)**. |

## 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](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/overview)** uses the PxPlus **[KEYED](https://manual.pvxplus.com/directives/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](https://manual.pvxplus.com/pxplus-user-guide/file-handling/data-files/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](https://manual.pvxplus.com/data-dictionary/data-dictionary-utilities/ini-file-generation)** and **[SQL Create Table](https://manual.pvxplus.com/data-dictionary/data-dictionary-utilities/sql-create-table)** utilities.

## Creating a Data Dictionary Definition

Each of your data files can be defined by using **[Data Dictionary Maintenance](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/overview)**. 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, OCI, ADO or DB2). See **[Using External Databases to Create a Data Dictionary](https://manual.pvxplus.com/data-dictionary/introduction#external_db)**.

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](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/overview#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](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/overview#elements)** tab. |
| 3\. Define the keys | Define the primary and alternate keys for the physical file. See **[Defining Keys](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/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](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/updating-the-data-dictionary)**.<br>Note:  <br>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](https://manual.pvxplus.com/command-tags/odb)**, **[MySql](https://manual.pvxplus.com/command-tags/mysql)**, **[OCI](https://manual.pvxplus.com/command-tags/oci)**, **[ADO](https://manual.pvxplus.com/command-tags/ado)** or **[DB2)](https://manual.pvxplus.com/command-tags/db2)**. The **[Database Import Utility](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/database-import)** can be used to define the data dictionary and create database **[Prefix](https://manual.pvxplus.com/pxplus-user-guide/data-integration/external-databases/creating-the-prefix-file)** or **[Link](https://manual.pvxplus.com/pxplus-user-guide/data-integration/external-databases/creating-link-file)** 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](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/query-subsystem/overview)**, the **[Report Writer](https://manual.pvxplus.com/report-writer/introduction)**, the **[Views System](https://manual.pvxplus.com/views-system/introduction)**, and the **[File Maintenance Generator](https://manual.pvxplus.com/nomads-graphical-application/dictionary-based-development/fmgen/fmgen-introduction)** for quickly creating Web-based **[(Webster+)](https://manual.pvxplus.com/webster/webster)** and Windows-based **[(NOMADS)](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/getting-started)** file maintenance and data entry screens, report interfaces, etc.

Other PxPlus tools, such as the **[Bulk Edit Data Elements](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/bulk-edit-elements)** utility and **[File Link Maintenance](https://manual.pvxplus.com/data-dictionary/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](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/bulk-database-export)**, can be used to add and load tables in an existing database (ODB, MySql, OCI, ADO or DB2) by using PxPlus native files.

## See Also

**[Using the Data Dictionary](https://manual.pvxplus.com/data-dictionary/using-the-data-dictionary/overview)**
**[Data Dictionary Maintenance](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/overview)**  
**[Data Dictionary Utilities](https://manual.pvxplus.com/data-dictionary/data-dictionary-utilities/overview)**  
**[Data Classes](https://manual.pvxplus.com/data-dictionary/data-classes/overview)  
[Bulk Edit Data Elements](https://manual.pvxplus.com/data-dictionary/data-dictionary-maintenance/bulk-edit-elements)**
