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 :


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
OPT     WhenEQ    2
        Exsr      UPDSR
OPT     WhenEQ    4
        Exsr      DLTSR             
OPT     WhenEQ    5
        Exsr      DSPSR
        Exsr      ERRSR

        Clear            OPT

        UPDATE    SFL01
        READC     SFL01


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

Read more here:

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: