strange problem with error 3113

I don’t understand how ISN-REK(S,1) may be wrong in line:
GET SW ISN-REK(S,1)
?


1 SW VIEW OF XXXX1
...
1 SW2 VIEW OF XXXX1
...
    FOR S=1 TO 2                                     
        IF ISN-REK(S,1) EQ 0                    
          ESCAPE BOTTOM                                
        END-IF                                         
*                                                    
        /* IS GOOD ?
        RESET #ISN-OK                                  
        READ (1) SW2 BY ISN =  ISN-REK(S,1)     
          #ISN-OK := TRUE                              
        END-READ                                       
        IF NOT #ISN-OK                                 
          ESCAPE TOP /* NEXT ONE
        END-IF                                         
*                                                    
        GET SW ISN-REK(S,1)     <--- ERROR 3113
        ...
    END-FOR

Hi mun1ek,

As I understand you should receive a syntax error because array notation is not allowed for this operand in a GET statement.

Aldo

Your READ (1) loop will read one record from the file starting from ISN-REK. This does not assure that ISN-REK is valid, it may be reading the next higher ISN.

Your “is good” logic should look like this:

        /* IS GOOD ?
        RESET #ISN-OK                                 
        READ (1) SW2 BY ISN =  ISN-REK(S,1)   
          IF *ISN = ISN-REK(S,1)  
            #ISN-OK := TRUE                             
          END-IF
        END-READ                                       

There are other ways to code this, but that should eliminate the 3113 errors.