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

Stack Overflow in Open Cobol

I am using Open Cobol. I have a program that I have been running for several weeks. Yesterday, I got the following error: MERRILL_MAX_AMOUNTS.COB:46: libcob: Stack overflow, possible PERFORM depth exceeded I tried going back to other versions of…
0
votes
1 answer

GnuCOBOL Report Writer: syntax error, unexpected IS, expecting LEADING or TRAILING

Installed GnuCOBOL version 3.0-rc1.0 to try out the recent Report Writer additions. Attempting to compile the first listing [with the PIC X(52) being a fix by me to the too-small PIC X(51) in the book] in Chapter 18 of Beginning COBOL for…
0
votes
2 answers

Commas in cobol?

I'm still working with Cobol:) I have a question, let's take this code: ACCEPT A COMPUTE C= FUNCTION SIN(A) END-COMPUTE DISPLAY "Computing." …
aIDserse
  • 131
  • 8
0
votes
2 answers

How to remove end-of-proof symbol?

Every time I'm writing to an output file, there will always be an end-of-proof symbol (□). Consider the program below: IDENTIFICATION DIVISION. PROGRAM-ID. HEY. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT…
Satellite Sage
  • 440
  • 1
  • 4
  • 13
0
votes
1 answer

GnuCobol equivalent of NOSSRANGE

I want to specify a single byte area in linkage section. Program A could call program B as call 'PROGB' using mycopybook where mycopybook could be 500 bytes one time, 2000 bytes the next time etc etc. A "simple" way around avoiding the need to…
0
votes
1 answer

Cobol program A calls program B via an entry point in B and crashes

COBOL program B has 3 entry points. Linkage section contains 1 general area, and then 3 areas (call them link-sect-a, link-sect-b and link-sect-c) Cobol program A calls program B using entry 3. In z/OS, it's perfectly valid (and normal) to…
0
votes
2 answers

How to compile with GnuCOBOL

I am trying to add a task to compile a program but am having difficulty with setting environment variables. I have this: { // See https://go.microsoft.com/fwlink LinkId=733558 // for the documentation about the tasks.json format "version":…
paoloricardo
  • 1,353
  • 2
  • 11
  • 10
0
votes
3 answers

How do I prevent a Cobol program from going into an infinite loop if no match found on 2 flat files?

A Cobol program reads a record from a first flat file and compares it to the first record on a second flat file. However, because the first record from the first flat file does not match any records on the second flat file, the Cobol program goes…
Fet
  • 728
  • 3
  • 19
  • 33
0
votes
1 answer

OpenCobolIDE stopped working after macOS Mojave update

Before updating to macOS Mojave, OpenCobolIDE was working fine, but ever since I updated, every time I try to open the application, it just closes a second after I pressed the icon. This I probably compatibility issues with the now OS, but is there…
0
votes
1 answer

OpenCOBOL Complex ODO (OCCURS DEPENDING ON)

I am new to COBOL(and OpenCOBOL) and my question is about "complex-odo" (OCCURS...DEPENDING ON) in OpenCOBOL. I used 1.0 on following code ...... 01 W-PTDO-PROC-TBL. 05 W-PTDO-PROC-ENTRY OCCURS 0 TO 450 TIMES DEPENDING ON…
Bill Rong
  • 353
  • 4
  • 12
0
votes
2 answers

COBOL display all duplicates from a file

I have a file which includes a list of different names. Some of some show up twice or more. I want to display all artists which show up in this list twice or more. How do I proceed? Thanks in advance, Sloan
SloaN
  • 11
  • 3
0
votes
0 answers

FATAL ERROR in native method: ReleasePrimitiveArrayCritical: failed bounds check

I'm trying to connect my Java code with a C program (translated using GnuCobol) using JNI. Unfortunately, I can't access the C source code and rewrite in Java, so I've created a wrapper C program to call it. Help with the following…
Lucas Licursi
  • 42
  • 1
  • 8
0
votes
2 answers

cobol & JCL removing extra spaces

I am trying to accept input from jcl for example 'John Snow' and run it from my cobol program Im using JUSTIFIED RIGHT VALUE SPACES to move the string to the right side however I need to delete the extra spaces using my cobol pgm. example my…
Walee
  • 1
  • 2
0
votes
0 answers

JNA and JNI - Attempt to reference unallocated memory

I am using JNI (and now JNA to see if the issue changes) to connect Java to a C code. This code has two methods that I am trying to use and they should be called from Java code many times, however, when I do the native calls, I got it: Call method…
Julia Bel
  • 337
  • 4
  • 18
0
votes
1 answer

COBOL program won't end

I am currently writing a COBOL program with a screen that checks and display a record from a file. However, the program keeps getting stuck when I try to input a command other than "F" or "Q". While it is suppose to display a new screen with an…
user7910505