Cobol Compiler parameters

Hello Cobol’er,

II’m new im Cobol Prgramming and 've installed the IBM Linux Cobol Compiler on Ubuntu and the VS Editor. I’ve wrote my first Cobol Program but I have no idea how can I compile or debug the program. I need help.
Regards
Julius

Hi, for begginers you could use this site
https://www.tutorialspoint.com/compile_cobol_online.php
regards

If you are new to COBOLL I strongly suggest you to switch to GNU COBOL, even older 2.20 (Ubuntu 20.04 repo has it) is quite stable, supports several dialects such Microfocus and works nicely with DB2.

Hi,
it looks like you may have experience with the GNU Cobol compiler.
i try to work with GNU Cobol 3.2 on a windows 11 system.
at eht moment, have problems with the encoding. The files i work with are encoded in utf-8, but it seems, that cobc works only with ascii files and is not able to cope with special german characters like (ä,ö,ü,ß…).
my question: is there a compile option?

Best regards,

I’m using GNUCobol 3.1.2 in WSL/Ubuntu 22.04 and have no problem with special chars:

       IDENTIFICATION DIVISION.
       PROGRAM-ID. UTF.

       PROCEDURE DIVISION.

       MAIN.
           DISPLAY "áéíóú - ä,ö,ü,ß".
           STOP RUN.

If you are just doing hobby stuff I recommend you to switch to do your stuff in WSL/Ubuntu.

Any chance your file is not in UTF-8?
Did you build GNU COBOL yourself or get a pre-built?

FOLLOW UP:

I got GnuCOBOL 3.2 VBI for Windows from here:
https://www.arnoldtrembley.com/GnuCOBOL.htm

I compiled a program containing UTF-8 chars in Windows console and got “garbage” but is not COBOL or MinGW’s is console fault.

Before running your program change the code page of the console with:

chcp 65001

And you will see your UTF-8 characters.

Hope this helps.

Regards!

thank you for dealing with this issue!
i use the compiler (GnuCOBOL) 3.2.0
Built Jan 07 2024 20:12:03 Packaged Jan 07 2024 20:14:39 UTC
C version (MinGW) “13.2.0” on a windows11 maschine. the cobol source is encoded in utf-8.
The compile of the following cobol program…
"IDENTIFICATION DIVISION.
PROGRAM-ID. TESTPROG.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 FILLER.
05 K-UMLAUTE PIC X(003) VALUE ‘AÖÜ’.
01 Z-FELDER.
05 Z-UMLAUTE PIC X(003).
PROCEDURE DIVISION.
MAIN.
MOVE K-UMLAUTE TO Z-UMLAUTE.
STOP RUN.
"
…produces the following messages:
"
C:\test\TESTPROG.CBL:10: warning: value size exceeds data size [-Wothers]
8 | WORKING-STORAGE SECTION.
9 | 01 FILLER.
10 > 05 K-UMLAUTE PIC X(003) VALUE ‘AÃ-Ão’.
11 | 01 Z-FELDER.
12 | 05 Z-UMLAUTE PIC X(003).
C:\test\TESTPROG.CBL:10: note: value size is 5 [-Wothers]

the question is, how to configure the compiler resp. what compile options are needed to cope with special characters.
Best regards