Data Dictionary and PRO/5 Programming Principles

Traditionally, IOLISTs are used to handle file processing. When file layouts are changed on a system that runs traditional programs, each program that uses the newly changed files must be examined to see if it is referencing any of the fields affected by the change.

Some developers use special IOLIST files that are updated and then merged into programs. In a way, these IOLIST files are dictionaries, but they do not provide true flexibility because most of the programs that use the altered files must still be changed.

The key to flexible file management is to make application programs query the data dictionary at run time, as described in the previous section, instead of relying on hard-coded data structures in the programs.

Assume the LAST_NAME$ field in the CUSTOMER alias is moved to a new position in the record. Application programs with hard-coded references to this field (for example, CUSTOMER$(50,20)) would have to be modified. Conversely, programs that use the variable CUSTOMER.LAST_NAME$ would not have to be changed because the physical location of the name field is transparent to the program.

Note that in the sample code, the CUSTOMER alias is accessed with READ RECORD and WRITE RECORD commands rather than READ and WRITE. The READ RECORD and WRITE RECORD commands execute faster than READ and WRITE because the interpreter does not have to parse the data for terminators and assign variables.