CPF5149 error message when file is opened in update mode

2505 pts.
Tags:
AS/400
CL Program
OPNQRYF
In my CL program I have an OPNQRYF on a file with option as (*UPD) OvrDbf File(FDFILE) Share(*Yes) OpnQryF File(FDFILE) Option(*Upd) + QrySlt('STATUS *NE "A" *And + FREQ *GT "0" *And (FDSDTP *LT "' *Cat &CurDat *Cat '") *And (MATURITY *GT "' *Cat &CurDat *Cat '") ') After this I am calling an RPG program, and in that RPG I have declared the file in Update mode FFDFILE UF A E k Disk Then reading the file Setll *Loval FDFILE; Read FDFILE; This line throws error I/O error CPF5149 was detected in file Can anyone help me to figure out the issue?

Software/Hardware used:
AS400

Answer Wiki

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

Discuss This Question: 4  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
  • TomLiotta
    First thing I would do is remove the OPNQRYF command. Use a more modern technique such as a SQL VIEW. You'll find more help that way.   However, you're doing a READ on a query file that you've created only for *UPD. You might try OPTION(*INP *UPD) instead. I can't tell if it'll work or not. You didn't say anything about how FDFILE is defined.   Further, your F-spec shows that you want to open FDFILE to allow 'A'dditions to the file. If that's true, then you possibly ought to use OPTION(*INP *OUT *UPD) or maybe better OPTION(*ALL).   But it's just guesses. OPNQRYF is too old to remember any details.   Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    I agree  with Tom, change the options.OPNQRYF does work and may be required by your standards or specifications or experience.
    50,505 pointsBadges:
    report
  • shaik3
    Add KEYFLD(*FILE)
    to your opnqry file it will work.
    10 pointsBadges:
    report
  • WilsonAlano
    Hi,

    You missed SEQONLY(*NO) parameter.

    To use random access (SETLL) you need it.

    Wilson
    2,485 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