Maximum limit for dynamic array allocation

Post your questions on PL/I.

Moderator: Moderator Group

Post Reply
kaverisowmiya
Member
Posts: 2
Joined: Wed Nov 07, 2012 4:21 pm

Maximum limit for dynamic array allocation

Post by kaverisowmiya » 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!!!

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Nov 07, 2012 5:07 pm

Why can't you let us in on which line caused the problem?

You test for <= 2147483647 and then you add one right afterwards.

Are you going to do that loop often?

kaverisowmiya
Member
Posts: 2
Joined: Wed Nov 07, 2012 4:21 pm

Post by kaverisowmiya » Thu Nov 08, 2012 10:44 am

The program got abend before allocation itself, its not allocating the maximum index for array :(

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Nov 09, 2012 1:56 am

Is there some reason you did not answer the questions :wink:

If you want help, you need to humor the helpers and answer their questions . . .
Have a good one

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Fri Nov 09, 2012 1:59 am

If the abend happened BEFORE the allocation statement then why do you think the allocation statement is causing a problem? Which statement is at offset 136? Did you get your diagnostic 'BEFORE ALLOCATE' in your SYSPRINT. If not then either your did not even get that far or the abend was after BUT you need to double up on your PUT SKIP to ensure it comes out.
Regards
Nic

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others