ILE C/C++ Programmer's Guide


Level Checking to Verify Descriptions

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:

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:

If the changes affect a field that your program uses, you must compile the program again for it to run properly.

C++ language onlyC++ users must use the GENCSRC utility for level checking.

C language onlyC users can use either the GENCSRC utility or the #pragma mapinc directive for level checking.

Note:
For more information on the differences between the GENCSRC utility and the #pragma mapinc directive, see Appendix A, The GENCSRC Utility and the #pragma mapinc Directive.

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.


[ Top of Page | Previous Page | Next Page | Table of Contents ]