MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Maximum Array size in PL/1

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
bala
Beginner


Joined: 08 Dec 2005
Posts: 17
Topics: 6
Location: India

PostPosted: Tue Dec 13, 2005 12:25 am    Post subject: Maximum Array size in PL/1 Reply with quote

Hi,

My following PL/1 program abends with an error "AN OUT-OF-STORAGE ABEND HAS OCCURRED". When I try with 1271000(array limit), yes it is working. But, the same value in different program abends again.
Code:

MAS: PROCEDURE OPTIONS(MAIN);
DCL PRO_WEEKS FIXED BIN(15) INIT(2);
DCL PRO_STORES FIXED BIN(31) INIT(1271120);
DCL 1 PROJ_ARR(PRO_WEEKS)   CONTROLLED UNALIGNED,
    3 WEEK                   FIXED BIN(15),
    3 OFFSET                 FIXED BIN(31),
    3 PROJ(PRO_STORES),
        5 STORE                FIXED BIN(31),
        5 OUTLET               CHAR(04),
        5 WT_CNT               FLOAT(24),
        5 ACV                  FLOAT(24);
ALLOCATE PROJ_ARR;
PUT SKIP  LIST('DONE');
END MAS;

Can I have answers for the following:
1)Is there any limit for array declarion in PL/1 ( from my search I got that +2147483647 to -2147483647 is the limitation. Is it so?? then why it is not working in my program??)
2) Is there any concept that this much amount of storage will be allocated to the program or it depends on the Server configuration. If yes, then array size limit will vary depends on the amount of storage required for other variables in the program. Is it so??

Thanks in advance for your reply.

Thanks,
Bala
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Tue Dec 13, 2005 1:44 am    Post subject: Reply with quote

Hi bala,

pls provide the exact error message, which version of PL/1 are you using ?

bauer
Back to top
View user's profile Send private message
bala
Beginner


Joined: 08 Dec 2005
Posts: 17
Topics: 6
Location: India

PostPosted: Tue Dec 13, 2005 3:20 am    Post subject: Reply with quote

I am using PL/I VER 2 REL 3 compiler.

I got the following Error message (from the log):

IBM912I 'ONCODE'=3920
AN OUT-OF-STORAGE ABEND HAS OCCURRED.
IN STATEMENT 100120 AT OFFSET +00010C IN PROCEDURE WITH ENTRY MAS

100120 1 0 ALLOCATE PROJ_ARR; (from the compiled pgm log of MAS)
Let me know if you need more details.

Thanks,
Bala
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Tue Dec 13, 2005 3:44 am    Post subject: Reply with quote

Try to uncrease the region size, see explanation of errormessage in manual sc26-4309-2.
Back to top
View user's profile Send private message
bala
Beginner


Joined: 08 Dec 2005
Posts: 17
Topics: 6
Location: India

PostPosted: Tue Dec 13, 2005 6:02 am    Post subject: Reply with quote

Yes, I have tried with Region = 0M (it takes max storage limit, hope I am right here) as well as Region = 2027M (2GB limit) also. I have got the same error. Any update do you like to give here??

(Thanks for your quick responses).
Bala
Back to top
View user's profile Send private message
Crox
Beginner


Joined: 29 May 2004
Posts: 52
Topics: 9

PostPosted: Tue Dec 13, 2005 3:12 pm    Post subject: Reply with quote

perhaps 24 bits mode instead of 31?
Back to top
View user's profile Send private message
Crox
Beginner


Joined: 29 May 2004
Posts: 52
Topics: 9

PostPosted: Tue Dec 13, 2005 4:09 pm    Post subject: Reply with quote

I mean does your current program address above or under the 16m line. I guess you need to address above. Is that perhaps not the case?
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Dec 13, 2005 5:29 pm    Post subject: Reply with quote

The max amount of storage available is dependent on lots of things; system exits (IEFUSI, et al), storage fragmentation, etc. It sounds strange, but a request for 20MB of storage is a bit large. On TSO systems I've used, I rarely have ever been able to allocate more than 30MB total, and almost never in large contiguous blocks. I guess I'd wonder about the usefulness of a million element array anyway. There isn't much you can do with it without lots of searching and arrays tend to have pretty bad performance characteristics (order n-squared) so you might find that using a different algorithm for whatever you are trying to do. If you are planning on searching this thing or sorting it, a (preferably balanced) binary tree might be a good bet. Or if PL/I has the ability to use data spaces or 64bit addressing, and I don't know if it does, that would be a good option too. Anyway, search for IEFUSI. Kolusu put out a good post about this.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group