Joined: 06 Jun 2008 Posts: 8217 Location: Dubuque, Iowa, USA
COBOL is a compiled language where files have to be defined during the compile process. It is not possible to specify at run time the record length that is required at compile time. You can specify files dynamically at run time in Assembler but not in COBOL.
So your idea may be very interesting but it is not possible to do this in COBOL. Try it in a different language or give up the idea altogether.