Hi all,
Please tell me
how can we prevent level check error..befor occuring dump
suppose we have have a pgm 'a' and a file 'pf1' i just want to be assure that level check error will occure or not..
regards/
Software/Hardware used:
ASKED:
November 7, 2009 9:13 AM
UPDATED:
November 11, 2009 9:13 PM
I agree with Philpl1jb. The level checking is there to protect you. However, I have had occassions to write utilities meant to read through any file. In this case, level checking is meaningless. If this is what you want to do, you can use a program described file in your F spec.
Discussion on Program Described files
Remember when you compile the program have the library list set properly to pick up the correct version of the file.
Phil
Do you want to know why level checks occur? Or do you want to know how to process a file that will have a level check?
The preferable way to disable level checks is with OVRDBF LVLCHK(*NO). This takes the decision out of the program object and forces the caller to make the explicit declaration the level checking may be ignored.
However, that is not intended for normal production use. It should only be used when the mechanism is understood and the implications are approved.
Tom
If you want to avoid serious problems, I would not allow an override of the program to continue if there is a level check. I would instead do a compare of the file level ID on the file with the program reference for that file in a CL before calling the program and if it is not equal then I would not run the program but rather take some other action so you do not get a hard program halt or dump.
Lovemyi
a bit of a tongue-in-cheek answer here, but …
how about using a production environment with
controlled update access ? …