Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can allocate a larger array size??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
pch1982cn

New User


Joined: 02 Apr 2006
Posts: 10
Location: Dalian.China

PostPosted: Mon Apr 24, 2006 12:58 pm    Post subject: Can allocate a larger array size??
Reply with quote

All,

Look at the code below:

Code:
DCL FD_ARRAY_LENGTH           FIXED BIN(31) INIT(200);
DCL FD_ARRAY_MAX              FIXED BIN(31) INIT(0);
DCL 1 FD_ARRAY               (FD_ARRAY_LENGTH) CONTROLLED
     ,5 TERR_TYPE            CHAR(18)                   

FD_ARRAY_LENGTH = 500;
ALLOCATE FD_ARRAY;

DO WHILE(MORE_DATA);

    FD_ARRAY_MAX = FD_ARRAY_MAX + 1;

    IF FD_ARRAY_MAX > FD_ARRAY_LENGTH THEN
        /*  ARRAY SIZE IS NOT LARGE ENOUGH  */
    ELSE
        FD_ARRAY.TERR_TYPE(FD_ARRAY_MAX) = '....';
   
END;


In the section of comments. Can I allocate a larger array size? I don't want to have the first 500 values lost. i.e. don't want to FREE first and ALLOCATE again.

Is it possible in PL/1? Thx!
Back to top
View user's profile Send private message

k_vikram07

New User


Joined: 23 Nov 2005
Posts: 35

PostPosted: Fri Jun 09, 2006 6:00 pm    Post subject:
Reply with quote

Yes You can.

index = 501;
ALLOCATE FD_ARRAY(index);

It allocates the 501th element of FD_ARRAY and so on.

-Vik
Back to top
View user's profile Send private message
pch1982cn

New User


Joined: 02 Apr 2006
Posts: 10
Location: Dalian.China

PostPosted: Mon Jun 12, 2006 7:49 am    Post subject:
Reply with quote

Thanks Vik ..

But this doesn't make sense ..

the first 500 elements are missing then icon_sad.gif
Back to top
View user's profile Send private message
lalgv

New User


Joined: 19 Apr 2006
Posts: 2

PostPosted: Mon Jun 12, 2006 12:50 pm    Post subject: Re: Can allocate a larger array size??
Reply with quote

It is not possible to allocate bigger larger array size without free first array.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts Increase the screen size after split mistah kurtz TSO/ISPF 2 Fri Sep 02, 2016 6:39 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts ALTER of an IDMS AREA with NEW/OLD pa... Awanti IDMS/ADSO 2 Mon Mar 14, 2016 10:01 pm
No new posts symbolic parm - allocate dsn krrp JCL & VSAM 11 Sat Oct 31, 2015 8:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us