¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: COBOL help opening datasets to append records.


 

¿ªÔÆÌåÓý

No - there is no EXTEND mode - too early.

Can I suggest that you use ISAM mode instead for this file if needed create a simple key if there is no field that you can use say starting with 1.

Then OPEN I-O, then all WRITE statements for a new record will work with the added benefit if also using REWRITE if you need to update an existing record.

See the documentation from Jay regarding the use of ISAM type files with Cobol for how to do it.

Vince


On 15/03/2024 13:30, Alejandro olivan Alvarez wrote:

Hi folks.

So I'm trying to append records to an existing dataset with COBOL... wich should be quite straight forward: OPEN EXTEND MY-FILE

But it seems the compiler does not support that opening mode.
I took a look at the 1972 IBM book I use as a reference for the included compiler and, at OPEN clause, section (very brief one... so maybe not a comprehensive guide with not all options covered), I see that it only mentions INPUT and OUTPUT, no EXTEND whatsoever.
So while I believe that it is indeed possible, the thing is that there must be for sure a way to perform such a fundamental operation, even with this compiler.

As anyone a clue? Am I missing something?

Thanks you.
Cheers.
Alex.??
_._,_._,_

Join [email protected] to automatically receive all group messages.