first I've got to ask for your forgiveness. I've just startet with Cobol and I come from Java, C++ and C# (oop). So also I have some problems with variable - and programmingstructur.

Now that I have figurt out the base rules of programming Cobol I would like to code a linked list. Unfortunately there are only some Cobol code snippets in the www. But to understand the whole code I need a complete implementation of a linked list.

So I know its overcharged for you, but I would like to ask you for it. It would help me a lot.

I have some problems with variable constructions. For example in C you make a struct an creating intances of a variable. How can I make the same in Cobol? Of course Cobol doesnt know any kinds of variable instances, so how can I realize a simple linked list ... (forewarded linked list)?

I have known about COBOL LE function CEEGTST that "gets heaps of storage" and CEEFRST that "frees the storage". I never used it, but you can search more on them.
Array implementation for linklist will be much easier i guess..

And you can control the linklist operations INSERT, DELETE using indiactor-var and index-var.
Indiacator-var should identify next valid occurence number and index-var can be used to access a particualr node.
This is vary crude picture which came to my mind at this time, there can be more efficient method too.. Need to here from you now..

Below I have pasted an example that my buddy sent me. I think he snagged it off the internet. I forget where it come from. I remember testing it and finding a bug so hopefully the version below includes my fix. I think it does but beware.

Note that the version below uses embedded sub-programs but this is not necessary. The version below uses CEEGTST to dynamically allocate memory and is probably closer to what you are looking for. Not that CEEGTST can be issued from within CICS or batch.

As well, beware if you intend to do this from within a CICS transaction. The memory allocated by CEEGTST will not persist until task termination, as would be the case with CICS GETMAIN. Storage acquired by CEEGTST will be release automatically when the run unit collapses - or of course when you explicitly release it yourself.