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

ALLOCATION function in PL/1


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Mon May 17, 2010 12:34 pm
Reply with quote

Hi, Please let me know the following :

If I have the following alloactions made :

ALLOCATION (a)
ALLOCATION (b)
ALLOCATION (c)

all the above variables are based on the pointer X.

Now, I want to use the variable b, how to use it? should I free anything before using the variable b?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon May 17, 2010 12:45 pm
Reply with quote

What does your code look like? Do you have 3 separate ALLOCATE statements?

Each ALLOCATE statement acquires an area of storage and sets a pointer -in your case, x. ALLOCATE (b) will overwrite the pointer value set in x for ALLOCATE (a) and ALLOCATE (c) will overwrite the value set for (b).

If you are finished with a variable/structure you should release it before overwriting the pointer addressing it.

Garry.
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Mon May 17, 2010 12:49 pm
Reply with quote

Alright thanks Garry
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 CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
Search our Forums:

Back to Top