Troubleshooting
Problem
This document describes typical ways that message CPF4131 can be caused.
Resolving The Problem
This document describes typical ways that message CPF4131 can be caused.
When CPF4131, Level check on file &2 in library &3 with member &4, is received, it is normally the result of changing and recompiling a file without recompiling the programs that use the file. In some cases, this presents no problem because the change to the file does not affect the program (for example, new fields that have been added to the file but are not needed in the program). In this case, a CHGPF, CHGPRTF, and so on, can be used to change the LVLCHK parameter to *NO. This is not recommended for database files unless you know what has changed and that it does not affect the program.
Note: Making this change could cause data integrity problems in some cases; for example, when a field length or field type has been changed. In these cases, the program should normally be recompiled. Printer files and display files can also produce incorrect output when field lengths or types have been changed with this option. Changing the file itself affects all programs using the file. Therefore, using the OVRDBF command for each program that uses the file may be more appropriate. This would allow you to allow only certain programs to ignore the level check.
Many users regularly make all files LVLCHK(*NO) but maintain database standards where they add only to the end of a file and recompile all programs when other changes are made to the files. This allows them to make minor changes to files without recompiling a large number of programs. Properly managed, this presents no problems. Other users take a more cautious approach and use LVLCHK(*YES), which is the default for IBM® create (CRTxxxx) commands. A problem arises when a user attempts to make sure all of their files are at LVLCHK(*YES) and globally change all files in all libraries to ensure none have been changed to LVLCHK(*NO). The problem arises because specifying all libraries includes IBM-supplied files used with display commands (DSPxxxx), which are stored in library QSYS. This includes display to screens and printers. If a user has a problem where one or more IBM display (DSPxxxx) commands fail with message CPF4131, the printer file or display file has been changed to LVLCHK(*YES). These files are shipped with LVLCHK(*NO) from IBM. If only one command is failing, use the CHGPRTF command to change print files, and the CHGDSPF command to change display files. To ensure all IBM-supplied printer and display files are set to their proper setting, use the following commands:
CHGPRTF FILE(QSYS/*ALL) LVLCHK(*NO)
CHGDSPF FILE(QSYS/*ALL) LVLCHK(*NO)
Note: Some IBM commands that display to a screen actually produce a spooled file and display the spooled file to the screen. In that case, check for printer files rather than display files. Verify this by using the command on a system that is functioning normally and look at the top of the screen. The top line says Display Spool File when this method is used.
When CPF4131, Level check on file &2 in library &3 with member &4, is received, it is normally the result of changing and recompiling a file without recompiling the programs that use the file. In some cases, this presents no problem because the change to the file does not affect the program (for example, new fields that have been added to the file but are not needed in the program). In this case, a CHGPF, CHGPRTF, and so on, can be used to change the LVLCHK parameter to *NO. This is not recommended for database files unless you know what has changed and that it does not affect the program.
Note: Making this change could cause data integrity problems in some cases; for example, when a field length or field type has been changed. In these cases, the program should normally be recompiled. Printer files and display files can also produce incorrect output when field lengths or types have been changed with this option. Changing the file itself affects all programs using the file. Therefore, using the OVRDBF command for each program that uses the file may be more appropriate. This would allow you to allow only certain programs to ignore the level check.
Many users regularly make all files LVLCHK(*NO) but maintain database standards where they add only to the end of a file and recompile all programs when other changes are made to the files. This allows them to make minor changes to files without recompiling a large number of programs. Properly managed, this presents no problems. Other users take a more cautious approach and use LVLCHK(*YES), which is the default for IBM® create (CRTxxxx) commands. A problem arises when a user attempts to make sure all of their files are at LVLCHK(*YES) and globally change all files in all libraries to ensure none have been changed to LVLCHK(*NO). The problem arises because specifying all libraries includes IBM-supplied files used with display commands (DSPxxxx), which are stored in library QSYS. This includes display to screens and printers. If a user has a problem where one or more IBM display (DSPxxxx) commands fail with message CPF4131, the printer file or display file has been changed to LVLCHK(*YES). These files are shipped with LVLCHK(*NO) from IBM. If only one command is failing, use the CHGPRTF command to change print files, and the CHGDSPF command to change display files. To ensure all IBM-supplied printer and display files are set to their proper setting, use the following commands:
CHGPRTF FILE(QSYS/*ALL) LVLCHK(*NO)
CHGDSPF FILE(QSYS/*ALL) LVLCHK(*NO)
Note: Some IBM commands that display to a screen actually produce a spooled file and display the spooled file to the screen. In that case, check for printer files rather than display files. Verify this by using the command on a system that is functioning normally and look at the top of the screen. The top line says Display Spool File when this method is used.
[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000001i3qAAA","label":"IBM i Db2-\u003EDB Objects"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]
Historical Number
10950529
Was this topic helpful?
Document Information
Modified date:
25 November 2024
UID
nas8N1018445