When an ILE C/C++
program that uses externally described files is compiled, the compiler
extracts the record-level and field-level descriptions for the files
referred to in the program and makes those descriptions part of the
compiled program. When you run the program, you can verify that the
descriptions with which the program was compiled are the current descriptions.
This process is referred to as level checking.
When it creates the associated header file, the server assigns
a unique level identifier for each record format. The following information
determines the level identifier:
- Record format name
- Field name
- Total length of the record format
- Number of fields in the record format
- Field attributes (for example, length and decimal positions)
- Order of the field in the record format
Note: It is possible for files with large record formats (many
fields) to have the same format level identifiers even though their
formats may be slightly different. Problems can occur when copying
these files if the record format names of the from-file and the to-file
are the same.
If you change any of the data description specification (DDS) items
in the preceding list, the level identifier changes.
When you create or change files, and you specify that you want
level checking:
- The system checks the level identifier to determine whether the
description of the record format you are using was changed since the
program was compiled.
- If that information has changed so much that your program cannot
process the file, the system notifies your program of this condition.
If the changes affect a field that your program uses, you must
compile the program again for it to run properly.
C++ users must use the GENCSRC utility for level
checking.
C users can use either the GENCSRC utility or the #pragma
mapinc directive for level checking.
If you make changes that do not affect the fields that your program
uses, you can run the program without compiling again by entering
an override command for the file and specifying LVLCHK(*NO). For example,
suppose that you add a field to the end of a record format in a database
file, but the program does not use the new field. You can use the
Override with Database File (OVRDBF) command with LVLCHK(*NO) to enable
the program to run without compiling again.
Note: The Override with
Database File (OVRDBF) command can be used with DDM to override a
local database file named in the program with a DDM file. The DDM
file causes the associated remote file to be used by the program instead
of the local database file.
The use of level checking ensures file integrity. It alerts you
to the possibility of unpredictable results.
An alternative to level checking is to display and analyze the
file description to determine if the changes affect your program.
You can use the Display File Field Description (DSPFFD) command to
display the description or, if you have the source entry utility (SEU),
you can display the source file containing the DDS for the file. To
display the format level identifier defined in the file, use the Display
File Description (DSPFD) command.
Note: When you are displaying the
level identifier, remember that the record format identifier is compared,
rather than the file identifier.