You can generally use DSPPGMREF against a program to see if a format level check will be possible. The output will list a file name along with any referenced record format and format level identifier.
Hi Tom can you please explain it cause…. in my sense with cl program we are not going to update PF just we are accessing it.. so for accessing of PF can we get Level Check Error.
Please Explain it if i am wrong….
Even though you are not upating a PF, you are still going to open it. It is the Open that causes the level check. Does this help?
An UPDATE isn’t needed. Programs that directly reference physical or logical files are compiled with buffer definitions that are based on the file format definitions. A format definition describes the data types and sizes of the fields in the buffer.
The file description is external from the program. That’s the reason these are called “externally described” files. You don’t need source code to describe the file in your program. You only need to reference the file, and the compiler and the database bring the definitions in for you.
If you later change a file format by adding or removing fields or by changing a field’s data type or length, the buffer definition in the compiled program must be changed to match. You must recompile the program so the compiler can insert the new definitions. Otherwise your program will be accessing the wrong parts of the I/O buffer when a field is retrieved from a record.
Your program could attempt to retrieve a date field from a part of the buffer that now contains an amount field. Or it might try to access a 7-digit numeric value from a part of the buffer that now contains only a 5-digit numeric value.
If you have changed the buffer definition, the file format identifier will be different. This is simply a protection that helps to prevent you from running a program over a file that has been changed to a new structure. It prevents a number of types of “data exception” errors.
The compiled program holds a record of the buffer definition. When the program tries to open a file, it automatically warns you that the file buffer has changed and that unpredictable results may happen. The warning is the “level check” error.