Questions tagged [gnucobol]

GnuCOBOL is a free (like both in "free speech" and in "free beer") COBOL compiler, formerly known as OpenCOBOL. It implements a substantial part of the COBOL 85, COBOL 2002 and COBOL 2014 standards, as well as many extensions. GnuCOBOL translates COBOL into C and compiles the translated code using the native C compiler on various platforms, including GNU/Linux, Mac OS X, IBM z/OS, Unix, AS/400, and Microsoft Windows.

GnuCOBOL is an implementation of COBOL. For further information see:

An IDE explicit targeting GnuCOBOL is Gix-IDE, which comes with a source-level debugger, ESQL preprocessor and more. Editors based on vscode can also be setup for a "near IDE" experience to edit, compile and debug GnuCOBOL.

Please report bugs and raise issues you see with migrations to GnuCOBOL at either the discussion boards or in the feature request tracker.

Additional tools and COBOL source samples tested with GnuCOBOL are made available by the community.

See info pages for COBOL and COBOL85 for more information about the language.

201 questions
0
votes
2 answers

Output is wrong

Written my program but I cannot get the right output as needed Below is my code and my input with the output. Also does my procedure program make sense or should I revise it, it seems it makes sense but after looking at different books I'm not sure…
0
votes
1 answer

Compiling COBOL program on mac yosemite 10.10.2

While I'm running my COBOL code: $ cobc hello.cob I'm getting an error: clang: error: unknown argument: '-R/opt/local/lib' (Today,) I installed GnuCOBOL as root with $ port selfupdate $ port install open-cobol
Rajdeep
  • 69
  • 5
0
votes
3 answers

output a report with sub-headers in COBOL

the format of input file is like this: Region ******* Company Name A B C A C with many lines. I need to get a output file to rearrange the file with headers like this: Company…
FrankT
  • 1
  • 2
0
votes
1 answer

configure: error: gmp.h (GMP) is required

when i try to install open-cobol i run ./configure then this error shows in the end: configure: error: gmp.h (GMP) is required then i do this: sudo apt-get install libgmp3-dev but i got this: Reading package lists... Done Building dependency tree…
Rachid O
  • 13,013
  • 15
  • 66
  • 92
0
votes
1 answer

COBOL to MSSQL table creation

We are trying data load to SQL server. So Can anyone suggest appropriate table schema for below mentioned Layout. 01 PRECALC. 06 NEWGROUP57. …
0
votes
1 answer

Error: syntax error unexpected '(' i n COBOL

I have some error in this program. When I compile, the Code show error like this prak.cob: In paragraph 'isi-data-tabel': prak.cob:34: Error: syntax error, unexpected '(' Please check code below, this is error in line 34: isi-data-tabel. …
0
votes
3 answers

OpenCobol file status 35

I'm studying Cobol, but I have a problem when reading a file, cobol is returning the status of the file as 35... I checked on the internet what it is this status, and from what I understand is that the system does not find the file, but I created…
Alexandre
  • 1,985
  • 5
  • 30
  • 55
0
votes
3 answers

Random function always returns same result, despite different seeds

I'm trying to create a random number generator (from which some random numbers will later be converted into an [A-Z] character). I've got the main part of the random generator working, but I constantly receive the same random result…
Jeroen Vannevel
  • 43,651
  • 22
  • 107
  • 170
0
votes
1 answer

why am I getting an error in the identification division?

The following code : IDENTIFICATION DIVISION. PROGRAM-ID. tester. PROCEDURE DIVISION. greet_program. DISPLAY "HELLO WORLD !". STOP RUN. produces a compiler error which says : Error: syntax error, unexpected WORD, expecting PROGRAM_ID I am…
saplingPro
  • 20,769
  • 53
  • 137
  • 195
0
votes
1 answer

Need help figuring out why Im getting a File Sharing Failure STATUS=61 message at runtime

For a homework assignment we are practicing multilevel control breaks in file processing. We grab data from an input file, process each group (in this case: a property management routine that calculates total rent for the month from offices,…
user1364920
  • 21
  • 1
  • 2
0
votes
3 answers

Cobol not numeric name

I am having some trouble with some cobol code. In the following code bellow it causes these two errors. The compiler does not like when I try and do the addition. CH7PPB.CBL:158: Error: 'NEW-DUES' is not numeric name CH7PPB.CBL:161: Error:…
amedeiros
  • 939
  • 2
  • 15
  • 24
0
votes
2 answers

How do I create an executable file with OpenCOBOL?

Upon finishing a COBOL program, how do I compile it into an executable file that may be run on other PCs? I'm using OpenCOBOL via cygwin.
yogo
  • 47
  • 2
  • 5
-1
votes
2 answers

gnucobol "unexpected Identifier, expecting DIVISION"

I write simple program: 000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. dnd. 000300 AUTHOR. Ishayahu Lastov. 000400 DATE-WRITTEN. 15/05/2023 000500 ENVIRONMENT DIVISON. 000600 DATA DIVISION. 000700 01 Username PIC X(20) 000800 01 CharactersCount…
Ishayahu
  • 349
  • 1
  • 19
-1
votes
1 answer

What changes do I have to make to the below code to keep from repeating the last output record?

My task is to read data from an input file that has 10 records, with each field separated by a semicolon (;), then write to an output file. But in the output file, I have to use a space, instead of a semicolon (;). But the problem is that in the…
-1
votes
2 answers

PC COBOL program to JCL

I have the following simple COBOL program - written for the PC. It simply reads a file from the computer and writes to the file: ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT CUSTOMER-FILE ASSIGN TO "C:Customers.dat" ORGANIZATION…
Tom Taulli
  • 11
  • 2
1 2 3
13
14