That will vanish with rc2 (maybe a warning that can be explicit enabled). It tells you that you have defined a varying size, but there's only one FD entry with a defined fixed size.
Either patch cobc or change the 01 variable to
According to the GnuCOBOL programmer's guide, section 6.2.1. File/Sort-Description,
The varying clause for the FD entry should be coded this way for variable length records:
~~~ [ RECORD { CONTAINS [ integer-7 TO ] integer-8 CHARACTERS } ]
{ IS VARYING IN SIZE }
{ ~~~~~~~ }
{ [ FROM [ integer-7 TO ] integer-8 CHARACTERS }
{ ~~ }
{ DEPENDING ON identifier-6 ] }
~~~~~~
After that, I believe the 01 record under the FD should be coded for the maximum record length. And "identifier-6" must be an integer numeric data item in Working Storage and it cannot be signed (a negative record length is illegal).
There is also an option for different record lengths under the FD where each record length has its own 01 record definition, but that's probably not what you want for this application.
Kind regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm practicing from a book and the FILE-CONTROL code is the next one
I still don't know what's the issue if COBOL is capable of controling record limits like it is displayed in the code.
That will vanish with rc2 (maybe a warning that can be explicit enabled). It tells you that you have defined a varying size, but there's only one FD entry with a defined fixed size.
Either patch cobc or change the 01 variable to
Last edit: Simon Sobisch 2020-09-27
According to the GnuCOBOL programmer's guide, section 6.2.1. File/Sort-Description,
The varying clause for the FD entry should be coded this way for variable length records:
~~~
[ RECORD { CONTAINS [ integer-7 TO ] integer-8 CHARACTERS } ]
{ IS VARYING IN SIZE }
{ ~~~~~~~ }
{ [ FROM [ integer-7 TO ] integer-8 CHARACTERS }
{ ~~ }
{ DEPENDING ON identifier-6 ] }
~~~~~~
After that, I believe the 01 record under the FD should be coded for the maximum record length. And "identifier-6" must be an integer numeric data item in Working Storage and it cannot be signed (a negative record length is illegal).
There is also an option for different record lengths under the FD where each record length has its own 01 record definition, but that's probably not what you want for this application.
Kind regards,