File Variables

File variable names are the names associated with data fields. They are defined as part of the record layouts during file definition.

The name, definition, and default attributes of all file variables are maintained in the PROIV Data Dictionary. When a new variable name is created during file definition, the variable name and its attributes are stored in this dictionary.  

If a pre-existing file variable name is specified during file definition the default attribute values are retrieved from the dictionary and a message appears warning that the variable name already exists.  
Attributes entered subsequently for pre-existing file variable will override default values. However, such amendments are local to the file being defined and do not affect the dictionary.

Whenever a file variable name is used in defining a screen or report field, the attributes from the Data Dictionary is copied to the Field Definition screen. These values may be overridden.
 

Using File Variables in Functions 

Whenever a developer needs to access information in a file, the file must be referred to by the logical file name and the required data fields the file variable name

A file may be referred to more than once within a function but you must take care to ensure integrity of the data when writing records that have been read multiple times.

Likewise care must be taken when a function updates more than one file containing the same file variable name.

Comment on this topic

Topic ID: 730007