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

Implementation of Linked Lists


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Mon Mar 20, 2006 6:41 pm
Reply with quote

Hi Everybody,
Can anybody give me some idea on how to implement Linked Lists using either VS COBOL II or Enterprise Cobol ..

Thanks in Advance .
Raja Shekar
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Mar 20, 2006 7:47 pm
Reply with quote

Raja Shekar,

Please disribe what you mean by "LINKED LISTS", just so we're both on the same subject. Are you talking about storage management, or something else?

Please come back,

Dave
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Tue Mar 21, 2006 5:24 pm
Reply with quote

Hi DavidatK,
Linked List is a kind of storage management technique..It's one kind of a data structure where in you are going to allocate nodes dynamically. Each node is going to have one Pointer variable used to store the address of next node..the last node's pointer in the list is going to have null values...
Here a node can be a structure..for example

01 WS-STRUCT.
05 WS-STRUCT-NAME X(120).
05 WS-STRUCT-EMPID X(5).
05 WS-STRUCT-NEXT-NODE USAGE POINTER.

Thanks and Regards,
RSC
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Tue Mar 21, 2006 6:54 pm
Reply with quote

Hi,
Sorry,..i missed picture clause in the structure that i mentioned in my last post..

Regards,
RSC
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Mar 21, 2006 8:02 pm
Reply with quote

RSC,
Good, this is what I was hoping you were talking about. I've done this many time in assembler, and several times in COLOL using a large allocated COBOL table. You however, want to dynamically allocate each occurrence of the nodes as you need them.

Tell me how you envision this functioning. i.e. pseudo code.

Do you have the availability of a callable GETMAIN routine from your Cobol program? I hope your going to say yes.

This will be fun to do. We will use the Linkage section for your LINKED LISTS.

Dave
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Wed Mar 22, 2006 3:05 pm
Reply with quote

Hi Dave,

I have implemented this kind of linked lists using PL/1 and C. In those languages we have inbuilt functions to allocate memory dynamically. But in cobol i don't find any command or inbuilt function to allocate memory dynamically for any array or structure..
Sorry to say u Dave that we don't have any GETMAIN routine kind of stuff..

Thanks and Regards,
RSC
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Mar 22, 2006 8:48 pm
Reply with quote

RSC,

Well, this makes it harder, but maybe not impossable. Let me think on this for awhile and get back to you.


Could you write somethink in PL/I or C that's callable from COBOL to allocate the storage and pass back the location?

Dave
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Thu Mar 23, 2006 6:01 pm
Reply with quote

Hi Dave,
I can write a PL/I program to allocate memory..but i don't know how to call it from COBOL..

Thanks
RSC
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Mar 27, 2006 8:04 am
Reply with quote

RSC,

This I cannot help you with. If it dosn't use the standard calling parameter list, I don't know. We do NO PL/I in our shop. Maybe someone will have experience with this call.

Dave
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts SMS:- Efficient filter lists in ACS All Other Mainframe Topics 7
No new posts RACF passphrase implementation problems All Other Mainframe Topics 1
No new posts Changeman: add library name for stati... Compuware & Other Tools 2
This topic is locked: you cannot edit posts or make replies. Unable to debug a linked program usin... IBM Tools 1
No new posts Unable to debug a linked CICS program... Compuware & Other Tools 3
Search our Forums:

Back to Top