I need a helping hand with one situation. I’m getting error NAT1009. I already read another posts about this error, but all of them suggest trying FIND NUMBER, but I don’t need the quantity of records, I really need to read them all, to check 2 values (from 2 variables that aren’t descriptors or in any super) in each record found in this file. In this case, how can I overcome this problem?
I have a few questions before I can give an informed answer.
How many records do you need to read to get your information? Is it the entire file? How big is your file?
Does this need to run online or can you run it in batch mode?
Is this a one-time/occasional report or does it need to run frequently?
Some things to get around NAT1009 (too many adabas calls between I/O).
If the report will be run frequently, consider adding descriptors to the file definition to get to your data directly.
Look into increasing the limit using the MADIO session parameter.
If the program runs online, you could add a processing window that pops up at an interval below the MADIO threshold. If I can find an example, I’ll post it below.
Here is some copycode that I use to put up a non-interactive window.
**---------------------------------
IF *DEVICE NE 'BATCH'
ADD 1 TO #WAIT-CTR
ADD 1 TO #WAIT-TOTAL
IF #WAIT-CTR GE #WAIT-LIMIT
RESET #WAIT-CTR
SET CONTROL 'WFNC11L38B8/20'
SET CONTROL 'N'
INPUT (IP=OFF)
/ 005T 'Processing your request.'
// 005T 'Total records:' #WAIT-TOTAL (AD=OI )
SET CONTROL 'WBM'
END-IF
END-IF
**---------------------------------
You will need to define #WAIT-CTR, #WAIT-TOTAL, and #WAIT-LIMIT in your program and initialize #WAIT-LIMIT to a reasonable number, e.g. 20 or 100.
About 60.000 records.
No, it’s not the entire file.
It will be running online, but only if a specific functionality is used.
It’s not a report, it is really a processing that needs to be done in real time when a search functionality is used.
You probably defined #WAIT-LIMIT as (N4). Try making it an (I4) which can handle much larger numbers. Integers are also more efficient for Natural counters.
Hi. I would like to be able to do this, but I not all of my search fields are descriptors, actually there’s only one descriptor… my FIND is like this at the moment:
FIND MY-VIEW WITH F1 = #NUM-CODE
WHERE F2 = 'R' OR = 'S'
AND F3 = #YEAR
AND F4 > 0
I already tried to change the fields in WHERE for ACCEPTS and REJECTs inside the FIND, but then the error changes to NAT3021: An invalid CID value was detected after many calls.
I don’t know what to do now… Thanks by the way, Eugene.
Get the DBA to change the DDM to make fields F2, F3 and F4 = “N” in the descriptor column of PREDICT instead of a blank. Then regenerate DDM. This causes no changes to the physical file in ADABAS only allows NATURAL to use non-DE in WITH clause. DBA may also need to change ADARUN parms to allow non-DE searches. Ultimately this is more efficient.
Eugene (Gene) Miklovich
ADABAS/NATURAL Systems Support and DBA
Cell: 916-202-7047
Normal Hours: 8am-4pm E.T.
Please call or text if assistance needed outside these hours.