More trouble from my older source code. Is there a compiler directive to handle this? I can edit this one but there are 10s more created in parts of the code that is used for screen layouts.
251294-", (M)ale, or (F)emale :M:".error:invalidlinecontinuation
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
More trouble from my older source code. Is there a compiler directive
to handle this? I can edit this one but there are 10s more created in
parts of the code that is used for screen layouts.
251294- ", (M)ale, or (F)emale :M:".
error: invalid line continuation
IF you have hyphens in cc7 I have to 'ASSUME' that it is a Fixed format
program so just compile with the default settings should do the jon if
you like to be sure just use
cobc -x -fixed program.cbl
If it is free format then this line looks like an error so convert it
to free format.
etc.
Vince
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, continuation lines are a standard COBOL feature. They tell the compiler to either continue literals of the previous code line (which then has a starting but not ending quote) or COBOL-words.
But this can all be misleading - continuation lines really need some context - a single line is nothing anyone can "debug", just guess...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I jumped to the conclusion that it was a legacy compatibility issue causing it to not accept the continuation. The issue is not as simple as that as contunuations elsewhere work as I expect. Sorry for that lack of clarity, I'm out of practice.
I can work around by editing the line to a single line. However a lot of this is generated by another COBOL program so to fix it nicely I need to look at how the generator would choose not to need a continuation, which seems like a problem too far if I can avoid it.
Here's a better example from the list output . The continuation line full stop should complete the declaration statement. The generator got to column 80 and started a continuation to add the full stop. It is lonely (but usually functional) on the following line.
I'm using -fixed as columns 1-6 are used for comments. column 1 often used to comment the whole line, column 7 is mostly continuation.
Thanks for your help.
Last edit: Dave Davidson 2020-06-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2020-06-30
So is the code inbounds ? Columns 7 thru 72 inclusively.
You mentioned Column 80.
73 - 80 are not inbounds.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2020-07-01
Re inbounds. My description didn't state that the generator program outputs 80 column lines to the generated copy file but it writes spaces into the information area (73-80).
This code compiled with MF COBOL last time I wanted to compile.
The code snippet in my 2nd example can be made to work if I replace x(030) with x(30) and use the saved column to put the full stop on the line avoiding the need for the continuation.
I am very out of date, the standards for continuation may make this construction invalid now. It may even have been invalid and just compiler tolerated back then.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2020-07-01
Are all of the syntax errors related to the continuation only being a . (dot / period) ?
Hard to tell without more example code.
MF would not care that the declaration is not terminated with a period - as long as the next statement can be "lexed", for instance a level number.
I'll recreate your example and run it thru MF, IBM, and Fujitsu.
See what happens :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks to everyone that's contributed to this project the compiler is a great piece of work.
I managed to get my program running. The program itself is mostly 40 years old.
The issues with continuation errors weren't continuation specifically - mostly it was all sorts of things that the old compilers had allowed past a syntax check but were being picked up now. If code that were generated had issues in the templating. I was surprised how many errors there were in the old code. Missing fullstop, missing quotes, and fullstop as the only character on the continued line.
Last edit: Dave Davidson 2020-07-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good to know. Thank you for the update - and the fixed program would very likely to also compile on the old environment when you've fixed these issues.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
More trouble from my older source code. Is there a compiler directive to handle this? I can edit this one but there are 10s more created in parts of the code that is used for screen layouts.
On 30/06/2020 21:00, Dave Davidson wrote:
If it is free format then this line looks like an error so convert it
to free format.
etc.
Vince
No, continuation lines are a standard COBOL feature. They tell the compiler to either continue literals of the previous code line (which then has a starting but not ending quote) or COBOL-words.
But this can all be misleading - continuation lines really need some context - a single line is nothing anyone can "debug", just guess...
I jumped to the conclusion that it was a legacy compatibility issue causing it to not accept the continuation. The issue is not as simple as that as contunuations elsewhere work as I expect. Sorry for that lack of clarity, I'm out of practice.
I can work around by editing the line to a single line. However a lot of this is generated by another COBOL program so to fix it nicely I need to look at how the generator would choose not to need a continuation, which seems like a problem too far if I can avoid it.
Here's a better example from the list output . The continuation line full stop should complete the declaration statement. The generator got to column 80 and started a continuation to add the full stop. It is lonely (but usually functional) on the following line.
I'm using -fixed as columns 1-6 are used for comments. column 1 often used to comment the whole line, column 7 is mostly continuation.
Thanks for your help.
Last edit: Dave Davidson 2020-06-30
So is the code inbounds ? Columns 7 thru 72 inclusively.
You mentioned Column 80.
73 - 80 are not inbounds.
Re inbounds. My description didn't state that the generator program outputs 80 column lines to the generated copy file but it writes spaces into the information area (73-80).
This code compiled with MF COBOL last time I wanted to compile.
The code snippet in my 2nd example can be made to work if I replace x(030) with x(30) and use the saved column to put the full stop on the line avoiding the need for the continuation.
I am very out of date, the standards for continuation may make this construction invalid now. It may even have been invalid and just compiler tolerated back then.
Are all of the syntax errors related to the continuation only being a . (dot / period) ?
Hard to tell without more example code.
MF would not care that the declaration is not terminated with a period - as long as the next statement can be "lexed", for instance a level number.
I'll recreate your example and run it thru MF, IBM, and Fujitsu.
See what happens :-)
Thanks to everyone that's contributed to this project the compiler is a great piece of work.
I managed to get my program running. The program itself is mostly 40 years old.
The issues with continuation errors weren't continuation specifically - mostly it was all sorts of things that the old compilers had allowed past a syntax check but were being picked up now. If code that were generated had issues in the templating. I was surprised how many errors there were in the old code. Missing fullstop, missing quotes, and fullstop as the only character on the continued line.
Last edit: Dave Davidson 2020-07-05
Good to know. Thank you for the update - and the fixed program would very likely to also compile on the old environment when you've fixed these issues.