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
3
votes
1 answer

Using a translate API to convert from Cobol or gnucobol to other language

I am looking for an example using Cobol either mf cobol or gnucobol. I would like an alternate of VB or C. Old time coboller since Cobol 61. I have looked at the Java and python examples but they are not clear to me. Parameter sizes, contents, and…
3
votes
2 answers

GnuCOBOL entry point not found

I've installed GnuCOBOL 2.2 on my Ubuntu 17.04 system. I've written a basic hello world program to test the compiler. 1 IDENTIFICATION DIVISION. 2 PROGRAM-ID. HELLO-WORLD. 3 *--------------------------- 4 DATA DIVISION. 5 …
3
votes
1 answer

Data entered not stored correctly

I have a problem with the Compiler for the programming language COBOL. I use the program "OpenCobolIDE" (GnuCOBOL 1.1 Mingw). Firstly here is the code of an example program. IDENTIFICATION DIVISION. PROGRAM-ID. HelloWorld. DATA DIVISION. …
Booster
  • 33
  • 2
3
votes
1 answer

How can I list directory contents in GnuCOBOL?

I know my question is rather generic (and it looks like "please do all of my work for me"), so let me make it somewhat clearer: I'm - more or less - a COBOL beginner, the only thing I've done with it so far was a small FastCGI application for a…
jekyll
  • 78
  • 1
  • 10
3
votes
3 answers

Opening file for reading in COBOL

I'm using OpenCobolIDE 4.7.4 (it's based on GnuCOBOL) on Windows 10 and trying to compile this program opening a file for reading: IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. …
Quentin
  • 1,090
  • 13
  • 24
3
votes
1 answer

Start a child process in COBOL

How to start a child process in GnuCOBOL? In Node.js, we can use either spawn or exec to start child processes: var proc = require("child_process").spawn("ls", ["-l"]); proc.stdout.on("data", function (chunk) { console.log(chunk); }); // or var…
Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474
3
votes
4 answers

Is there a way I could make a perform not end (like an infinite while loop)?

Is there anyway to do this? I want the perform to exit only when a exit statement is executed. If not I want it to keep looping.
Benjer
  • 153
  • 2
  • 10
3
votes
1 answer

Find a substring in a string in COBOL

My problem is, given a variable which I read from a file, see if it contains or matches another string. In other words, find in a file all the records whose variable BRADD PIC X(30) matches or contains a string introduced by keyboard. I'm very…
daniegarcia254
  • 1,157
  • 4
  • 17
  • 36
2
votes
1 answer

END-PERFORM needed, but also not needed?

COBOL code with terminal errors The error messages are: fizzbuzz.cob:12: error: PERFORM statement not terminated by END-PERFORM fizzbuzz.cob:18: error: syntax error, unexpected END-PERFORM I'm getting a compile error with this program because it…
Durandal
  • 23
  • 3
2
votes
1 answer

Is there an form of Java interop that is standardized in COBOL?

A quick glance suggests IBM's, Microfocus's and GNU COBOL's offerings for Java and COBOL interop are all different APIs. However, on Wikipedia there is currently the quote that the 2002 spec "Improved interoperability with other programming…
bbarker
  • 11,636
  • 9
  • 38
  • 62
2
votes
1 answer

How to convert c++ code to cobol correctly

I have written code to get the number that appears the most in an array. The main function will make a call to readData which will read data into the array that I passed to the readData subroutine. After the readData subroutine has executed, i use…
Darthvader
  • 35
  • 3
2
votes
1 answer

Scons for COBOL

I want to create a builder in scons works with COBOL. Here is a start: import re Import('env') # Source: # src/cpy/COPYBK1.cpy # src/cpy/COPYBK2.cpy # src/cpy/COPYBK3.cpy # src/bat/PROG1.cbl # src/bat/PROG2.cbl # These commands would run: # cobc…
Be Kind To New Users
  • 9,672
  • 13
  • 78
  • 125
2
votes
2 answers

Cobol - alternate key not found

I have an own application where you can simulate a library (customer can lend and return books). I have a LOAN file where I store the book-id, customer-id, loan-date and return-date for each loan. This is my file select: SELECT LOAN-FILE …
eisem
  • 185
  • 1
  • 10
2
votes
1 answer

gnucobol gcc: error: `cob-config: No such file or directory

I'm trying to practice a C program (hello.c) calling cobol program (say.cob) from the manual gnucobol. ---- say.cob ------ IDENTIFICATION DIVISION. PROGRAM-ID. say. ENVIRONMENT DIVISION. DATA DIVISION. LINKAGE SECTION. 01…
SRI
  • 131
  • 8
2
votes
3 answers

Getting Overlapping error in COBOL program

Cobol program : PROGRAM-ID. SCHPROG. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT MYFILE ASSIGN TO INDD ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL. …
Rahul
  • 117
  • 1
  • 14
1 2
3
13 14