level check error
275 pts.
0
Q:
level check error
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/
ASKED: Nov 7 2009  9:13 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
24540 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
When the DSPFD and the DSPPGMREF show the same format level values.
If they don't the program should be recompiled.

Or you can court disaster and turn off the level check on the file with the chgpf command.
This is absolutely the wrong thing to do.
Phil
Last Answered: Nov 7 2009  2:50 PM GMT by Philpl1jb   24540 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Craig Hatmaker   0 pts.  |   Nov 8 2009  4:37AM GMT

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

 

Philpl1jb   24540 pts.  |   Nov 8 2009  3:36PM GMT

Remember when you compile the program have the library list set properly to pick up the correct version of the file.
Phil

 

TomLiotta   7665 pts.  |   Nov 9 2009  4:40AM GMT

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

 

Lovemyi   1470 pts.  |   Nov 9 2009  7:53PM GMT

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

 

ASWDEVELOPER   205 pts.  |   Nov 11 2009  9:13PM GMT

a bit of a tongue-in-cheek answer here, but …
how about using a production environment with
controlled update access ? …

 
0