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

How to convert a literal to Hex value

Reading a hex representation of value in 2 characters, for example 0C from a text file, I need to store the corresponding hex value X'0C' in a program variable as in the following code. I know that COBOL allows to do something like MOVE X'0C' TO…
NoChance
  • 5,632
  • 4
  • 31
  • 45
-1
votes
1 answer

Why doesn't GnuCOBOL's rounding syntax compile?

I would be very grateful for any pointer towards what exactly it is that I am doing wrong with the very minimal, very trivial COBOL program below. It performs a rounding of a result with COBOL's standard tool, the language element ROUNDED. The…
-1
votes
1 answer

Explain COBOL-DB2 compilation in ubuntu linux in opencobol?

I wanted to run my cobol-db2 program in ubuntu linux using opencobol compiler, please explain me the process of running my program in linux using opencobol.
-2
votes
1 answer

GnuCobol calling C function with arguments - problem when function has more than 2 arguments

I have case like below testlib.c with two basic functions, one returning value second returning result by reference int sum(int a, int b) { return a + b; } void ref(int a, int *b) { *b = a * a; } compiling library gcc -c -static -o…
mysiar
  • 430
  • 1
  • 5
  • 14
-2
votes
1 answer

COBOL Beginner. Completely lost

This is the assignment. I have no clue where to start. I have written some of the code but I am not sure if it is even correct. Assignment Details Here is what code I have written so far IDENTIFICATION DIVISION. PROGRAM-ID. PROGRAM1. …
-4
votes
1 answer

I can't display an error message to the user using the screen section in COBOL

I'm building a cobol system and I can't display an error message to the user using the screen section. How can I do this? And how do I get the ESC key that the user presses to return to the menu? I'm using GNUCobol and OpenCobol.
1 2 3
13
14