AS/400 query on editable subfile with SFLNXTCHG

165 pts.
Tags:
AS 400
AS/400 subfile
I have an editable subfile that lists 10 records. Option = 4 to delete record from PF.
I input 7 (invalid option) on 2nd record and 4 (valid option) on 5th record. Now, I get error on 2nd record as the option is invalid (fine till this point).
Now, I remove option 7 from 2nd record and hit enter. Ideally I'm expecting the deletion operation to take place on the 5th record. But, control is still pointing to 2nd record. What is the mistake here?
I am setting SFLNXTCHG operator *on before updating the SFL.

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.

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.
  • TheRealRaven
    Without seeing your code, we can't tell what the problem is. Most likely, your code doesn't ignore the change you made to subfile record #2 when you typed the '7' and later also typed a blank (or deleted the '7').

    A 'changed' record is one that you typed in. It doesn't mean that the content is the same.
    24,375 pointsBadges:
    report
  • deepu9321
    When you make the Option Blank, Program (READC) will read this subfile record to see what has been changed.

    When it comes to pointing the control, This must be a program bug, Pasting your code helps.
    4,955 pointsBadges:
    report
  • sri8707
    This is my piece of code-

    READC     SFL
    DoW not%eof()
    If        Option = '4' 
    // perform deletion action here
    Else
    //Error = Invalid option
    Set SFLNXTCHG = on
    Update SFL
    EndIf
    ReadC SFL    


    165 pointsBadges:
    report
  • sri8707
    Got the issue. Please ignore this.
    165 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.

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

Following

Share this item with your network: