How to encounter error UPDATE and DELETE without prior input WHEN want to update to SUBFILE in RPGLE

I'm having an error shown as in the picture below :

Error

It happens when I want to update existing record and also when I put wrong option and blank option. When I debug, I realize that the error comes when want to UPDATE SUBFILE.

OSR     Begsr
        ReadC    SFL01
        DOW      *IN91 = *OFF
        
        Select
OPT     WhenEQ    2
        Exsr      UPDSR
OPT     WhenEQ    4
        Exsr      DLTSR             
OPT     WhenEQ    5
        Exsr      DSPSR
        Other
        Exsr      ERRSR
        EndSL

        Clear            OPT

        UPDATE    SFL01
        READC     SFL01

        Enddo
        Endsr

What should I do? Do I need to chain from logical file? Please help me. Thanks in advance



Read more here: https://stackoverflow.com/questions/67931125/how-to-encounter-error-update-and-delete-without-prior-input-when-want-to-update

Content Attribution

This content was originally published by Nurhidayah Yaacob at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: