Handling NATERROR 3113

I have a work file contains a list of ISN’s , The list has some deleted ISN’s from the ADABAS file. the requirement is to Read the workfile and use GET statement with the ISN and update a field on ADABAS file hence this the program should get the valid ISN’s and invalid ISN’s should be ignored. I tried using ON ERROR for handling NAT 3113 in the natural program but still the program fails with NAT error 3113. Can anyone give me an idea on how to handle this error.

Thanks in Advance.

Regards,
Ashok.

I suggest you change your GET to

RD.                                
READ file BY ISN FROM #ISN THRU #ISN
  WRITE 'ISN' #ISN 'found'       
END-READ                           
IF  *COUNTER (RD.) = 0             
  THEN                             
    WRITE 'ISN' #ISN 'not found'   
END-IF                             

It’s not as efficient as the GET, but allows you to trap the missing ISNs quite easily.

If you have access to NatParms, you could set RCGET to OFF, then code

G. GET file #ISN
IF  *ISN (G.) = 0             
  THEN                             
    WRITE 'ISN' #ISN 'not found'
  ELSE
    ... process record ...
END-IF                             

Set the dynamic parameter RCGET=OFF for this Batch(?) job.
This will “ignore” any NAT3113 errors in your session.
.
— Parameter Reference —
RCGET - Handling of Response Code 113 for GET Statement
This Natural profile parameter specifies the action to be taken if Adabas Response Code 113 (requested ISN not found) is returned during the execution of a GET statement.
.
Possible settings:
ON Response Code 113 causes the program to be terminated.
OFF Response Code 113 will be ignored, the system variable *ISN will be set to “0”, and processing will continue.
Default setting - ON
Dynamic specification - yes
Specification within session - no

Thank you Ralph and Peter for your valuable information. I am not given access to set RCGET parameter. i have done my work with READ ISN logic.

I got a similar problem some months ago and solved it using a subprogram with an own on-error-routine. The main program looks like this:

...
READ WORK 30 #isn
  CALLNAT 'SUBPROGN' #isn
END-WORK

The Subprogram:

ON ERROR
IF *ERROR-NR = 3113
  ESCAPE MODULE
END-IF
END-ERROR

GET MYFILE #ISN
...