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.
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.