Will level check error occur or not?

310 pts.
Tags:
Level Check
RPGLE
Hi all, Please tell me How can we prevent level check error before occurring dump? Suppose we have have a PGM 'a' and a file 'pf1'. I just want to be assure that level check error will occur or not. Regards

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Ambrish 82
    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
    0 pointsBadges:
    report
  • philpl1jb
    Remember when you compile the program have the library list set properly to pick up the correct version of the file. Phil
    49,970 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • Lovemyi
    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
    2,310 pointsBadges:
    report
  • ASWDEVELOPER
    a bit of a tongue-in-cheek answer here, but ... how about using a production environment with controlled update access ? ...
    405 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following