Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Implementation of Linked Lists

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Implementation of Linked Lists
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    Post subject: Re: Implementation of Linked Lists
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    Post subject: Re: Implementation of Linked Lists
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    Post subject: Re: Implementation of Linked Lists
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    Post subject: Re: Implementation of Linked Lists
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    Post subject: Re: Implementation of Linked Lists
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    Post subject: Re: Implementation of Linked Lists
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    Post subject: Re: Implementation of Linked Lists
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    Post subject: Re: Implementation of Linked Lists
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Unable to debug a linked program usin... moumi das IBM Tools 1 Thu May 23, 2013 3:20 pm
No new posts Unable to debug a linked CICS program... moumi das Compuware & Other Tools 3 Thu May 23, 2013 2:48 pm
No new posts Recompiling static linked programs hiravibk COBOL Programming 3 Thu Mar 07, 2013 10:27 pm
No new posts Heap and Linked List enrico-sorichetti COBOL Programming 9 Wed Feb 20, 2013 12:48 pm
No new posts How to get the SAR Library which list... gileshpg JCL & VSAM 6 Mon Jun 11, 2012 2:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us