as you can see some rows are shifted to the right
it happens that sometimes are shifted so far that i get compile errors
but sometimes happens that identifiers are truncated .. and cobc find it as valid because it found a valid similar identifier name, or because i write AT clauses ending at column 71 all the AT shift over column 72 .. so when i run the program i get strange C errors
to investigate i take an hexdump of the source file.. all shifted lines contains an hex '0909' before string starts .. i'm using italian-utf-8 .. and this is Devanagari Letter U of indian alphabet...
i do not know how this can be inside my source... i use vim to edit and sometimes happend that instead of use
:u for undo i'm into caps lock and insert :U ...
editing with cancel key before the string i resolve...
so two problems one is related how this characters are inside my source and this is not a cobol problemi
the problem is cobol compiler that shift the instructions 8 characters right and i repeat sometimes extends ver column 72 and still compile correctly giving hard to find errors...
Thanks for the support
Maurizio
Last edit: Maurizio Bongini 2025-05-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Look at code for TAB char so you will need to use text editor with them shown and not all do so.
Failing that make all code FREE format and drop first 6 chars of text (sequence number) and change any * in first cc to *>
The later you should do first.
Add at beginning of program >>source free starting cc7 or 8.
Last edit: Simon Sobisch 2025-05-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Look at code for TAB char so you will need to use text editor with them
shown and not all do so.
Failing that make all code FREE format and drop first 6 chars of text
(sequence number) and change any * in first cc to *>
The later you should do first.
Add at beginning of program >>source free starting cc7 or 8.
On 13/05/2025 16:20, Maurizio Bongini wrote:
Hi
Env Gnucobol 3.2 stable...
i met this strange prblem at compile time
i put here a simple piece of code of a big program to explain
here the source
|PERFORM UNTIL FINE OR EOF-DOCUMENTI PERFORM POSIZIONAMENTO-2 IF
EOF-DOCUMENTI DISPLAY 'EOF' ERASE EOL AT 2441 EXIT PARAGRAPH END-IF
PERFORM VISUALIZZA-DATI PERFORM VISUALIZZA-PRODOTTI RIGHE TIMES
DISPLAY TOTALE-PR AT 2161 MOVE T-CHIAVE(IDX2) TO CHIAVE ACCEPT
LETTURA-SEQ WITH UPPER AT 2129 END-PERFORM. |
i extract the pgm listing with cobc -P
495 PERFORM UNTIL FINE OR EOF-DOCUMENTI
496 PERFORM POSIZIONAMENTO-2
497 PERFORM VISUALIZZA-DATI
498 PERFORM VISUALIZZA-PRODOTTI RIGHE TIMES
499 DISPLAY TOTALE-PR AT 2161
500 MOVE T-CHIAVE(IDX2) TO CHIAVE
501 ACCEPT LETTURA-SEQ WITH UPPER AT 2129
502 END-PERFORM.
as you can see some rows are shifted to the right
it happens that sometimes are shifted so far that i get compile errors
but sometimes happens that identifiers are truncated .. and cobc find
it as valid because it found a valid similar identifier name, or
because i write AT clauses ending at column 71 all the AT shift over
column 72 .. so when i run the program i get strange C errors
to investigate i take an hexdump of the source file.. all shifted
lines contains an hex '0909' before string starts .. i'm using
italian-utf-8 .. and this is Devanagari Letter U of indian alphabet...
i do not know how this can be inside my source... i use vim to edit
and sometimes happend that instead of use
:u for undo i'm into caps lock and insert :U ...
editing with cancel key before the string i resolve...
so two problems one is related how this characters are inside my
source and this is not a cobol problemi
the problem is cobol compiler that shift the instructions 8 characters
right and i repeat sometimes extends ver column 72 and still compile
correctly giving hard to find errors...
Thanks for the support
--
Marco Antoniotti, Professor, Director tel. +39 - 02 64 48 79 01
DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY
CSCE 2025 - csce.lakecomoschool.org
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-P generates a preprocess program listing, which is mostly NOT what you want to have, it is mostly useful for automated tooling, without comments and "mostly" in free format.
-T would generated a "listing for the programmer" (to inspect, if you don't use tools that provide cross-references and "show definition" and similar, like vscode with extensions like Superbol and likely GixIDE provide).
-E generates a "compiler focused" preprocessed file to stdout (if you don't specify -o as well) - this should always be compilable as-is in free format.
--save-temps generates the compiler preprocessed file as -E (actually all compiles do that) and saves it under "sourcename.i" - I guess this is what you possibly want to use (otherwise you may want to not compile and only use -E)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Thaks to all for the quick answers
Forgive me but i'm not english mother tongue so really i have not clearly understood what to do
I put >>SOURCE FREE as first line of code but i get a lot of errors... i get the same errors if i remove this statement and i compile with -F (free) option
i recreate the problem with a small pgm and i attach it here the source and the output of
cobc -E tab.cbl >tab.lst
as you can see the preprocess is not able to recognize the AT clause
Yes you have reason all troubles are introduced by the TAB key i used to move instructions
editing the file with Vim it reports me that ACCEPT DEBUG AT 2180 ends at column 68 so it shoud be valid, the compiler should recognize it
i use vim because it has the cobol.vim plugin
(I passed all my working life at IBM.. .i used the old good ISPF)
are there some linux editor with cobol plugin to use instead of vim ?
the compiler behave correctly ?
thaks in advance again
UPD on the mean time i take a look at gnucobol FAQ ... i see Emacs and THE
(the post of Marco with "The editor" )
You possibly want to either adjust vim's tab with or cobc's (using -ftab-width=2).
You cannot use --free (or the newer variant -fformat=free) because of the use of column 7 for comments (free form would be *> "anywhere", col7 works fine as well).
In a setup similar like yours you may also want to compile with -Wcolumn-overflow or even -Werror=column-overflow, to recognize that directly on compile.
For editing outside of the console you can go with VSCodium and [superbol extension}(https://open-vsx.org/extension/OCamlPro/SuperBOL)
... but you may love an ISPF lookalike editor like https://sourceforge.net/projects/pipedit/ as well or even more (currently no direct debugging support in that - you'd use cobgdb in this case).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Thaks to all for the quick answers
Forgive me but i'm not english mother tongue do really i have not clearly
understood what to do
I put >>SOURCE FREE as first line of code but i get a lot of errors... i
get the same errors if i remove this statement and i compile with -F (free)
option
i recreate the problem with a small pgm and i attach it here the source
and the output of
cobc -E tab.cbl >tab.lst
as you can see the preprocess is not able to recognize the AT clause
Yes you have reason all troubles are introduced by the TAB key i used to
move instructions
editing the file with Vim it reports me that ACCEPT DEBUG AT 2180 ends at
column 68 so it shoud be valid, the compiler should recognize it
i use vim because it has the cobol.vim plugin
(I passed all my working life at IBM.. .i used the old good ISPF)
are there some linux editor with cobol plugin to use insteaf of vim ?
the compiler behave correctly ?
thaks in advance again
--
Marco Antoniotti, Professor, Director tel. +39 - 02 64 48 79 01
DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY
CSCE 2025 - csce.lakecomoschool.org
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Thanks to alla for the suggestions
i added to my compile scripts -Wcolumn-overflow
this will avoid s"egmentation fault", or "double free errors" at run time ...
in the mean time i will install Emacs
But i'm very interested to pipedit ... i download it but when i try to run i get pipedit: Could not open config file >(null)<, aborting..
I will open a thread to pipedit site
I hope no one will be offended if i say that ISPF was the best to edit files: powerful commands, and very simple to use
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There should be no "segmentation fault", or "double free errors" at run time because of a column overflow!
If you see any then please provide a reproducer for that!
For the editor... everybody has its own taste and there is no right or wrong, just "strong opinions" ;-)
The one thing that ISPF, emacs and vim (and edt) have in common: they all have their own special set of features and keystrokes, learning them takes some time and effort and "unlearning" to switch to a different editor is often hard.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No one is offended. I agree ISPF is the Best editor. I run most of my GnuCOBOL on linux so I use VIM , it just takes getting used to and learning a few commands like Y and p for copy paste lines... I like VIM .
But if you want to edit on Windows and like ISPF here is a product that is pretty much like it: https://github.com/michaelknigge/spf-editor/releases/tag/v365.3454.25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I remember now, I did try it in 2022 and I could not get it to work.
I downloaded it again and still could not get it to work.
The instructions are not clear enough.
I, on my linux box, download the zip, unzip and it says to run the c program.
I run it ./c and then do the
Compiling the editor
--------------------
use the shell script "c" to compile
Compiling the comp macro
------------------------
cd into the folder macros
use the shell script "c" to compile
I ran the binary pipedit.bin and it could not find the config file.
I put the config file in the bin dir with pipedit.bin
Then the config file could find the language .en file
I updated the config file to point to the .en file I copied from the git web site
I said it could not open it, but I couuld cat it using the very line it refered to.
I noticed it had a Makefile, I did make on it and same erros...
Same issues as 2022 I think.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
i just installed pipedit...
1) download pipedit.bin
2) copy it to your $HOME/bin
3) in the file section of sourceforge there is the pipedit.cfg file and the pdf file with a small documantation to install it...
4) you have to create a $HOME/.pipedit directory and put the cfg file
5) then add to .bashrc export PIPIEDITCFG=$HOME/.pipedit(pipedit.cfg
6) logout/login
and it works
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
it found the config file, but it now says can not find language file
config_path=>/home/mickeyw/pipedit-code/trunk/pipedit.cfg<
Could not open language file >/pipedit. <, aborting..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This editor is fit for programmers working on both main-frame and PC.
Its operation is based on mainframe SPF editor,
and like as other editor on PC, convenient short-cut key operation is hybrid.
How-To-Use is in docs/URL.txt, Copy-Paste the URL to your browser.
Hi
returning to the argument of this thread
i install pipedit ..
it correctly show tabbed instruction shifted to the right
I install Emacs
It correctly show tabbed instruction shifted to the right
I add cobol mode to Emacs and it works , nice colors but... but
IT DOES NOT SHOW TABBED INSTRUCTIONS SHIFTED TO THE RIGHT
IMHO
both vim and emacs code works correctly... the bug is in the both cobol plugins
next...
returning to segmentation faults and double free errors when get it i corrected last inserter instructions moving it the to the left...
IMHO
in this big program i used a lot of long identifiers.. may be that cobc unable to recognize truncation .. still find a valid identifier and store values in a wrong C char ...
if the probllem shoud happen i will create a small program so Simon can working on
Ciao
Maurizio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Chuck and I did some worst case variable naming.
We created 30 character names - all is well,.
See snippet below.
I don't think your long names will confuse COBC :-)
As far as "big programs" I have processed COBOL code with 50+ thousand statements successfully in GnuCOBOL
MOVE '1234 WAREHOUSE' TO
ORDER-WAREHOUSE
OF
ORDER-SHIP-TO
(T 2) ((( Q12345678901234567890123456789
OF PROGRAM-FIELDS +
R12345678901234567890123456789
OF PROGRAM-FIELDS
- 1) * 1) :(S12345678901234567890123456789
OF PROGRAM-FIELDS
* 1))
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Emacs (The Editor) may have tab substitution in place in cobol mode; usually it does.
In any case you can activate whitespace-mode to see tabs, if they are there.
Also, you can send jobs to a Hercules/Tk5 instance thanks to IRON-MAIN (shameless plug): https://github.com/marcoxa/iron-main . The machinery should be there to also send jobs (as in JCL) to z/OS, but I need help to ... iron out the wrinkles.
Plus remember: you cannot emulate Emacs in vi(m), but you can emulate vi(m) in Emacs (M-x evil)
MA
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2025-05-15
Hi i don't want waste time of other people ... but belive me i get this erors... i see it on the terminal.. what i done to correct is just shift instrunciond to the left... i do not rememeber wich instructions.. .
it was done before i decided to open this thread
trying to recreate will waste your time... my program do a lot of move from vsam to tables, and viceversa and from pic 9 to zoned pic..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Env Gnucobol 3.2 stable...
i met this strange prblem at compile time
i put here a simple piece of code of a big program to explain
here the source
i extract the pgm listing with cobc -P
as you can see some rows are shifted to the right
it happens that sometimes are shifted so far that i get compile errors
but sometimes happens that identifiers are truncated .. and cobc find it as valid because it found a valid similar identifier name, or because i write AT clauses ending at column 71 all the AT shift over column 72 .. so when i run the program i get strange C errors
to investigate i take an hexdump of the source file.. all shifted lines contains an hex '0909' before string starts .. i'm using italian-utf-8 .. and this is Devanagari Letter U of indian alphabet...
i do not know how this can be inside my source... i use vim to edit and sometimes happend that instead of use
:u for undo i'm into caps lock and insert :U ...
editing with cancel key before the string i resolve...
so two problems one is related how this characters are inside my source and this is not a cobol problemi
the problem is cobol compiler that shift the instructions 8 characters right and i repeat sometimes extends ver column 72 and still compile correctly giving hard to find errors...
Thanks for the support
Maurizio
Last edit: Maurizio Bongini 2025-05-13
Look at code for TAB char so you will need to use text editor with them shown and not all do so.
Failing that make all code FREE format and drop first 6 chars of text (sequence number) and change any * in first cc to *>
The later you should do first.
Add at beginning of program >>source free starting cc7 or 8.
Last edit: Simon Sobisch 2025-05-13
... or you can use The Editor (as in: Thou Shalt Not Have Other...) and set
up cobol-mode.
Cheers
MA
On Tue, May 13, 2025 at 5:41 PM Vincent (Bryan) Coen vcoen@users.sourceforge.net wrote:
--
Marco Antoniotti, Professor, Director tel. +39 - 02 64 48 79 01
DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY
CSCE 2025 - csce.lakecomoschool.org
Nuts forgot instead of changing source format to free by hand you program in contrib area called
changeformat.cbl which is in the changeformat folder i.e.,
gnucobol-contrib/trunk/tools/changeformat
Last edit: Simon Sobisch 2025-05-13
-P generates a preprocess program listing, which is mostly NOT what you want to have, it is mostly useful for automated tooling, without comments and "mostly" in free format.
-T would generated a "listing for the programmer" (to inspect, if you don't use tools that provide cross-references and "show definition" and similar, like vscode with extensions like Superbol and likely GixIDE provide).
-E generates a "compiler focused" preprocessed file to stdout (if you don't specify -o as well) - this should always be compilable as-is in free format.
--save-temps generates the compiler preprocessed file as -E (actually all compiles do that) and saves it under "sourcename.i" - I guess this is what you possibly want to use (otherwise you may want to not compile and only use -E)
Hi
Thaks to all for the quick answers
Forgive me but i'm not english mother tongue so really i have not clearly understood what to do
I put >>SOURCE FREE as first line of code but i get a lot of errors... i get the same errors if i remove this statement and i compile with -F (free) option
i recreate the problem with a small pgm and i attach it here the source and the output of
cobc -E tab.cbl >tab.lst
as you can see the preprocess is not able to recognize the AT clause
Yes you have reason all troubles are introduced by the TAB key i used to move instructions
editing the file with Vim it reports me that ACCEPT DEBUG AT 2180 ends at column 68 so it shoud be valid, the compiler should recognize it
i use vim because it has the cobol.vim plugin
(I passed all my working life at IBM.. .i used the old good ISPF)
are there some linux editor with cobol plugin to use instead of vim ?
the compiler behave correctly ?
thaks in advance again
UPD on the mean time i take a look at gnucobol FAQ ... i see Emacs and THE
(the post of Marco with "The editor" )
Last edit: Maurizio Bongini 2025-05-13
You possibly want to either adjust vim's tab with or cobc's (using
-ftab-width=2
).You cannot use
--free
(or the newer variant-fformat=free
) because of the use of column 7 for comments (free form would be*>
"anywhere", col7 works fine as well).In a setup similar like yours you may also want to compile with
-Wcolumn-overflow
or even-Werror=column-overflow
, to recognize that directly on compile.For editing outside of the console you can go with VSCodium and [superbol extension}(https://open-vsx.org/extension/OCamlPro/SuperBOL)
... but you may love an ISPF lookalike editor like https://sourceforge.net/projects/pipedit/ as well or even more (currently no direct debugging support in that - you'd use cobgdb in this case).
"I use vim because it has the cobol.vim"
Therein lies your problem :)
Devi usare Emacs con cobol-mode. E, nel caso, M-x evil :)
MA
On Tue, May 13, 2025 at 10:03 PM Maurizio Bongini bongmau@users.sourceforge.net wrote:
--
Marco Antoniotti, Professor, Director tel. +39 - 02 64 48 79 01
DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY
CSCE 2025 - csce.lakecomoschool.org
Hi
Thanks to alla for the suggestions
i added to my compile scripts
-Wcolumn-overflow
this will avoid s"egmentation fault", or "double free errors" at run time ...
in the mean time i will install Emacs
But i'm very interested to pipedit ... i download it but when i try to run i get
pipedit: Could not open config file >(null)<, aborting..
I will open a thread to pipedit site
I hope no one will be offended if i say that ISPF was the best to edit files: powerful commands, and very simple to use
There should be no "segmentation fault", or "double free errors" at run time because of a column overflow!
If you see any then please provide a reproducer for that!
For the editor... everybody has its own taste and there is no right or wrong, just "strong opinions" ;-)
The one thing that ISPF, emacs and vim (and edt) have in common: they all have their own special set of features and keystrokes, learning them takes some time and effort and "unlearning" to switch to a different editor is often hard.
No one is offended. I agree ISPF is the Best editor. I run most of my GnuCOBOL on linux so I use VIM , it just takes getting used to and learning a few commands like Y and p for copy paste lines... I like VIM .
But if you want to edit on Windows and like ISPF here is a product that is pretty much like it:
https://github.com/michaelknigge/spf-editor/releases/tag/v365.3454.25
Have you tried pipEdit on GNU/Linux?
No. I will do so today and let you know. Thanks.
I remember now, I did try it in 2022 and I could not get it to work.
I downloaded it again and still could not get it to work.
The instructions are not clear enough.
I, on my linux box, download the zip, unzip and it says to run the c program.
I run it ./c and then do the
I ran the binary pipedit.bin and it could not find the config file.
I put the config file in the bin dir with pipedit.bin
Then the config file could find the language .en file
I updated the config file to point to the .en file I copied from the git web site
I said it could not open it, but I couuld cat it using the very line it refered to.
I noticed it had a Makefile, I did make on it and same erros...
Same issues as 2022 I think.
seems the config file belongs to the home directory and possibly you need an environment var pointing to it: https://sourceforge.net/p/pipedit/discussion/bug_reports/thread/945f3c7b53/?limit=50#780d
Hi
i just installed pipedit...
1) download pipedit.bin
2) copy it to your $HOME/bin
3) in the file section of sourceforge there is the pipedit.cfg file and the pdf file with a small documantation to install it...
4) you have to create a $HOME/.pipedit directory and put the cfg file
5) then add to .bashrc export PIPIEDITCFG=$HOME/.pipedit(pipedit.cfg
6) logout/login
and it works
it found the config file, but it now says can not find language file
config_path=>/home/mickeyw/pipedit-code/trunk/pipedit.cfg<
Could not open language file >/pipedit. <, aborting..
edit the pipedit.cfg and set
language=default
However it is a minimal ispf ... it lacks some functions .. i can't file how to move line, the move line command is not implemented
Yes very limited. I think I will stick to VI on linux. Thanks for your help.
If you want to use an ISPF like editor on Linux, the Hybrid Editor is a pretty good implementation.
https://github.com/sakachin2/XE
XE
SPF like Editor xe 2025/01/20 V130B
This editor is fit for programmers working on both main-frame and PC.
Its operation is based on mainframe SPF editor,
and like as other editor on PC, convenient short-cut key operation is hybrid.
How-To-Use is in docs/URL.txt, Copy-Paste the URL to your browser.
!! THIS IS FREE SOFTWARE AND COMES WITH ABSOLUTELY NO WARRANTY.
Hi
returning to the argument of this thread
i install pipedit ..
it correctly show tabbed instruction shifted to the right
I install Emacs
It correctly show tabbed instruction shifted to the right
I add cobol mode to Emacs and it works , nice colors but... but
IT DOES NOT SHOW TABBED INSTRUCTIONS SHIFTED TO THE RIGHT
IMHO
both vim and emacs code works correctly... the bug is in the both cobol plugins
next...
returning to segmentation faults and double free errors when get it i corrected last inserter instructions moving it the to the left...
IMHO
in this big program i used a lot of long identifiers.. may be that cobc unable to recognize truncation .. still find a valid identifier and store values in a wrong C char ...
if the probllem shoud happen i will create a small program so Simon can working on
Ciao
Maurizio
Chuck and I did some worst case variable naming.
We created 30 character names - all is well,.
See snippet below.
I don't think your long names will confuse COBC :-)
As far as "big programs" I have processed COBOL code with 50+ thousand statements successfully in GnuCOBOL
Ciao Eugenio
Emacs (The Editor) may have tab substitution in place in cobol mode; usually it does.
In any case you can activate
whitespace-mode
to see tabs, if they are there.Also, you can send jobs to a Hercules/Tk5 instance thanks to IRON-MAIN (shameless plug):
https://github.com/marcoxa/iron-main . The machinery should be there to also send jobs (as in JCL) to z/OS, but I need help to ... iron out the wrinkles.
Plus remember: you cannot emulate Emacs in vi(m), but you can emulate vi(m) in Emacs (M-x evil)
MA
Hi i don't want waste time of other people ... but belive me i get this erors... i see it on the terminal.. what i done to correct is just shift instrunciond to the left... i do not rememeber wich instructions.. .
it was done before i decided to open this thread
trying to recreate will waste your time... my program do a lot of move from vsam to tables, and viceversa and from pic 9 to zoned pic..