NAT1009 Error

I get NAT1009 error and not able to understand why?

If I run below program , I get NAT1009 error. If I un-comment line# 0140 , the program runs fine.
Not sure why. I want the row count of table.


0010 * PROGRAM TO ACCESS DATABASE                
 0020 DEFINE DATA                                 
 0030 LOCAL                                       
 0040 01 #COUNT (N20) INIT<0>                     
 0050 01 XXXX-VIEW VIEW OF XXXX                 
 0060  02 XXXX-N-EMPLID                           
 0070  02 XXXX-M-NAME                             
 0080 END-DEFINE                                  
 0090 * ENTER EDIT OR E TO RETURN TO EDITOR       
 0100 READ XXXX-VIEW BY XXXX-M-NAME              
 0110 *                                           
 0120   COMPUTE #COUNT = #COUNT + 1               
 0130    
 0140 *  DISPLAY "ROW COUNT" #COUNT                
 0150 *                                           
 0160 END-READ                                    
 0170 DISPLAY             #COUNT                  
 0180 END                                         
                  - Error Message Nr. NAT1009 -                  

Program interrupted after too many ADABAS calls.

Tx *** Short Text ***

Program interrupted after too many ADABAS calls.

Ex *** Explanation ***

NATURAL counts all ADABAS calls and compares the result with
the setting of the parameter MADIO.
When this value is reached, a loop is assumed and the program
terminated.
The ADABAS-call count is reset to 0 after a screen I/O operation.

run it in batch

see “The database-call count is reset to 0 after a screen I/O operation.”

You are trying to read the whole file on line before a screen refresh. :wink:

tip:
Use FIND NUMBER syntax instead of reading all records

http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat825mf/pg/pg_exas.htm#FINDX11

Thanks Giles & Finn!!