IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can allocate a larger array size??


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Using Java/C/C++ to retrieve dataset ... Java & MQSeries 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts Dataset size increase on adding 1 byt... DFSORT/ICETOOL 8
Search our Forums:

Back to Top