Maximum limit for dynamic array allocation
Posted: Wed Nov 07, 2012 4:28 pm
We have declared the array like below one,
DCL A FIXED BIN(31) INIT(0);
DCL I FIXED BIN(31) INIT(0);
DCL AY(*) CHAR(1) CONTROLLED;
A = 2147483647;
FREE AY;
PUT SKIP LIST('BEFORE ALLOCATE');
ALLOCATE AY(A) CHAR(1);
PUT SKIP LIST('AFTER ALLOCATE');
DO WHILE (I <= 2147483647);
I = I + 1;
AY(I) = 'M';
END;
PUT SKIP LIST('I',I);
FREE AY;
and we got the following error in run time
********************************* TOP OF DATA **********************************
IBM0451S ONCODE=451 The STORAGE condition was raised.
From entry point SAMPLEM at compile unit offset +00000136 at entry offs
******************************** BOTTOM OF DATA ********************************
While checking for maximum array indexing , we got the limit of 2147483647 but its not working when we tried to allocate dynamically or by static.
Please provide us your suggestions
Thanks in advance!!!
DCL A FIXED BIN(31) INIT(0);
DCL I FIXED BIN(31) INIT(0);
DCL AY(*) CHAR(1) CONTROLLED;
A = 2147483647;
FREE AY;
PUT SKIP LIST('BEFORE ALLOCATE');
ALLOCATE AY(A) CHAR(1);
PUT SKIP LIST('AFTER ALLOCATE');
DO WHILE (I <= 2147483647);
I = I + 1;
AY(I) = 'M';
END;
PUT SKIP LIST('I',I);
FREE AY;
and we got the following error in run time
********************************* TOP OF DATA **********************************
IBM0451S ONCODE=451 The STORAGE condition was raised.
From entry point SAMPLEM at compile unit offset +00000136 at entry offs
******************************** BOTTOM OF DATA ********************************
While checking for maximum array indexing , we got the limit of 2147483647 but its not working when we tried to allocate dynamically or by static.
Please provide us your suggestions
Thanks in advance!!!