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
2
votes
4 answers

IBM S/390 mainframe COBOL source code

We have an S/390 mainframe at my new job that’s been running COBOL applications since the late 90’s. The mainframe is getting old enough that we need to migrate to a newer system. We’re a small enough business that we can’t warrant spending the…
NateBrink
  • 103
  • 8
2
votes
1 answer

GNUCobol (OpenCOBOL) error: libcob: module '»' not found

I'm converting a set of COBOL programs written for Microfocus's compiler for use with GnuCobol. So far, I've been moderately successful, only having to change some microfocus-specific date commands, along with using GnuCobol's -std=mf argument. I'm…
Kurtoid
  • 217
  • 5
  • 15
2
votes
4 answers

Cobol - parsing group items in a cobol program

I need to extract information from a COBOL program. I'm using the ANTLR grammar for COBOL. I need to extract group variables as a whole. I'm not able to extract this with ANTLR as the parser extracts every variable subdivision/group item as an…
Sahana
  • 53
  • 1
  • 6
2
votes
1 answer

OpenCobol & PostgreSQL on Windows with Visual Studio

I'm currently facing a problem with this team of 4. Using binaries I downloaded on kiska's site. I'm able to compile cobol to C and run it with cobcrun or compile it to an executable. However I can 't get opencobol to find the postgres…
Walfrat
  • 5,363
  • 1
  • 16
  • 35
2
votes
1 answer

How to accept numeric values in cobol using screen section

So i'm trying to make a simple program in cobol, using the screen section, that will just calculate the sum of 2 numbers. The compiler i'm using is the OpenCobolIDE. The problem is that i'm getting an error saying that my WS-N1 variable is not a…
Levi Moraes
  • 57
  • 1
  • 8
2
votes
2 answers

COBOL expecting end of file

I am using OpenCOBOL in the cygwin terminal to compile this program that is just supposed to read from an input text file and print it to a formatted output file. When I try to compile I get this error: programonerjm.cbl:13: Error: syntax error,…
2
votes
2 answers

How to clear screen and set cursor position to the end of the screen in cobol

So i'm trying to make a form-like screen where the user inputs his data and saves it in a .txt file. I'm using OpenCobolIDE and i'm currently going through problems in the clearing screen process. i have a kind of form that i made in the console…
Levi Moraes
  • 57
  • 1
  • 8
2
votes
2 answers

how to display decimal format output in cobol?

I am currently studying for a week an old programming language COBOL but had encounter a problem. this is the sample of a Cobol program. IDENTIFICATION DIVISION. PROGRAM-ID. MONTHLY. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. …
2
votes
1 answer

jni call involving open cobol dlls

I am trying to invoke an existing COBOL application using JNI. COBOL application structure is as follows. c-wrapper(main)-->COBOLProgram -> several dyn(.so) and static called modules The existing COBOL application involves several statically…
cobp
  • 772
  • 1
  • 5
  • 19
2
votes
1 answer

Compilation issue with COBOL Program

I have a cobol program that gives the following issues. Any help? This is basically a program to calculate a students GPA based upon the input file provided by the user. i compiled it using cobc -x -free, but still get the following issues. These…
Beast
  • 129
  • 1
  • 8
2
votes
1 answer

Executable program requested but PROCEDURE/ENTRY has USING clause

Does anyone one know what is causing this compilation error? I'm trying to compile a legacy COBOL program using OpenCOBOL. This is the error that I'm getting : Error: Executable program requested but PROCEDURE/ENTRY has USING clause This is how my…
Benjer
  • 153
  • 2
  • 10
2
votes
1 answer

How to do a two dimensional table (array) and fix errors

My outputs are not getting out right, and I'm not too sure how to go about doing a two dimensional array. I have my outputs follow by the outputs should look like..... Good example how to set up 2 dimensional table would help, since not sure what I…
2
votes
3 answers

Trouble with ACCEPT "ESC-CODE FROM ESCAPE KEY"

With Microsoft COBOL Compiler version 2.2 and I have this code that completely worked fine. IDENTIFICATION DIVISION. PROGRAM-ID. COCENTRY. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT COC-FILE …
Þaw
  • 2,047
  • 4
  • 22
  • 39
2
votes
3 answers

Why is the second if statement in this Cobol code not being evaluated (OpenCOBOL)?

identification division. program-id. quick. environment division. data division. working-storage section. 01 temp-val1 pic 9 value 1. 01 temp-val2 pic 9 value 2. procedure division. mainline. perform…
NickAbbey
  • 1,201
  • 2
  • 10
  • 17
2
votes
0 answers

SWIG, OpenCOBOL and mixing targets

OpenCOBOL uses intermediate C source on the way to compiled binary, giving it access to the entire libc universe. With a goal of centralized embedding of more than one SWIG wrapper: cobc -C nextbig.cob swig -java nextbig.i gcc nextbig.c…
Brian Tiffin
  • 3,978
  • 1
  • 24
  • 34