Error nat1222, help

Hi i use a X-ARRAY and i try to EXPAND with a ACCUMULATOR VARIABLE but when i execute the program the JCL drop that error and i don’t know how to solve it

“NAT1222 Memory required for statement execution not available.”

This is the X-ARRAY

1 X-ARRAY-CUIT (A222/1:*)
1 WK-FILE (A222)

This is the subroutine

DEFINE LOAD-VECTOR

READ WORK FILE 2 WK-FILE
        ADD 1 TO CONTADOR
END-WORK
CLOSE WORK FILE 2

EXPAND ARRAY VECTOR-CUIT-SIOYD TO (1:CONTADOR)

READ WORK FILE 2 WK-FILE
        ADD 1 TO I      
        MOVE WK-FILE TO VECTOR-CUIT-SIOYD(I)
END-WORK
CLOSE WORK FILE 2

END-SUBROUTINE

The statement is the following: i need comparate a file with another but the first file “file1” have a some objects
in invert order and the second file “file2” have in order objects and I thought put all objects from file1 in X-ARRAY and “travel” file2 asking for the objects from X-ARRAY and if the same objects write file1 and another file1

Can help me?, any response it’s welcome here, ty.
sorry for the ignorance i’m junior on this.

Natural fails to allocate the required memory. You could try increasing the REGION size of your job step. The maximum array size in Natural is 1G. The maximum LOCAL storage is also 1G. That is, if you fill the X-array to 1G, there will be no storage left for WK-FILE, CONTADDR, and I.

How many records are you trying to load into the X-array? Repeatedly searching a large array will be CPU intensive. I suggest you sort the first file into a temporary dataset and then perform a sequential match against the second file. Search the forums for “sequential match” for more information.

This topic is temporarily closed for at least 14 hours due to a large number of community flags.

This topic was automatically opened after 14 hours.

load around 96.979 records…

Now take the size of each record, multiply by 96.979 and see if that fits the region specification of your job.

For your comparison, do you REALLY need to keep the entire records in an array, or would it be sufficient to keep a “key” or some key element ?

the issue is the file1 have something like this because don’t have another fields to difference that another objects

i have something like this:

file1
JUANA AA14
JUANA AA13

file2 (in order that i need to generate the file)
AA13C
AA14C

FILE RESULT
JUANA AA13
JUANA AA14

it’s worth say the file1 it’s make with JCL and i understand JCL in the cases with all fields are the same get the first occurrence

As Ralph explained in this post SORT file 1 by the field containing your “key” (AA13, AA14) and then do a sequential mix-and-match, you might even get away without using an intermediate array at all.

Do a SORT.

READ WORK

SORT

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.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.