Questions tagged [cobol]

COBOL (COmmon Business Oriented Language) was the product of a US Department of Defense initiative to develop a standard and portable programming language for business applications. COBOL celebrated its 50th birthday in 2009. It is generally believed that new COBOL development is in decline but new ISO/IEC COBOL standards still evolve and a commercial commitment remains to keep the language relevant in today’s computing landscape.

COBOL (COmmon Business Oriented Language) was the product of a US Department of Defense initiative to develop a standard and portable programming language for business applications. COBOL celebrated its 50th birthday in 2009. It is generally believed that new COBOL development is in decline but a commercial commitment remains to keep the language relevant in today’s computing landscape.

Standards

The official COBOL standard is very slow to evolve due to a strong desire to keep the language relevant without compromising core strengths such as execution efficiency, interoperability with other languages and backward compatibility with earlier versions of the language.

The current COBOL ISO/IEC standard is ISO/IEC 1985:2014 Information technology -- Programming languages -- COBOL. ISO/IEC published a standard for 1985, 2002, 2014 and works on 2022.

Vendors of course continue to issue new releases of their COBOL compilers with unique non-standard features from time to time. As a consequence, COBOL dialects vary more than one might expect given the availability of standards.

Sources

There are several COBOL centered web sites where you can obtain further information:

Lightweight Editors with COBOL syntax highlighting

Various COBOL language code editor plugin are available:

1698 questions
8
votes
8 answers

Helping to ease COBOL programmers to .Net. What are your suggestions?

I have a number of COBOL programmers who are moving to .NET. I've found many struggle to adopt/understand OO programming principles. I don't have any COBOL experience, so my ability to find what few similarities there are is very limited. There's…
Rob
  • 1,320
  • 1
  • 8
  • 14
7
votes
4 answers

Is it possible to write a compiler in COBOL?

This blog post https://stackoverflow.blog/2020/04/20/brush-up-your-cobol-why-is-a-60-year-old-language-suddenly-in-demand/?cb=1 says "You can’t write a compiler or a kernel module in COBOL" I'm not a fan of COBOL and I'm not suggesting it would…
Caltor
  • 2,538
  • 1
  • 27
  • 55
7
votes
1 answer

Read COBOL COMP data in C#

I'm new to COBOL and I have been trying to read record information from a text file that is an output from the table. Most non-comp data-types i'm okay with, it's the 'COMP' ones i'm getting stuck on. I've been trying to figure this out all day…
ThatUser
  • 487
  • 6
  • 11
7
votes
6 answers

What are some good resources for getting started with COBOL programming?

I'm thinking about learning COBOL. Where should I start?
joeforker
  • 40,459
  • 37
  • 151
  • 246
7
votes
1 answer

How to pass linkage section data to another program's linkage section in COBOL

I'm working on a Wrapper/Bridge COBOL program that handles program calls and performs cross-cutting operations like logging,security-check etc. Main motivation is checking the security access for consumer program whether it has access to call the…
Tunceren
  • 754
  • 1
  • 8
  • 16
7
votes
1 answer

How COBOL handles division rounding by default?

In COBOL what is the result of COMPUTE RESULT1 = 97 / 100 COMPUTE RESULT2 = 50 / 100 COMPUTE RESULT3 = 32 / 100 COMPUTE RESULT4 = -97 / 100 COMPUTE RESULT5 = -50 / 100 COMPUTE RESULT6 = -32 / 100 When RESULT1/2/3 are: PIC S9(4) PIC…
RSFalcon7
  • 2,241
  • 6
  • 34
  • 55
7
votes
4 answers

Getting started with OpenCOBOL! ("Hello world!")

I'm trying to make a very simple COBOL program. I've gotten my directory, configurations, etc. all set up, but when I go to compile it I get this error: sampleCOBOL.cbl: In paragraph 'Main-Paragraph' : sampleCOBOL.cbl:9: Error: syntax error,…
Bryan Strobehn
  • 123
  • 2
  • 6
7
votes
4 answers

Is it possible to add inline comments in Cobol

Most modern programming languages give a way to add inline comments, generally those that use a newline character to indicate the end of a comment, and an arbitrary delimiter or sequence of tokens to indicate the beginning of a comment, while…
psychoslave
  • 2,783
  • 3
  • 27
  • 44
6
votes
1 answer

Ubuntu GnuCobol CURRENCY SIGN IS "£" causes compile errors

Using GnuCOBOL 2.2.0 on Ubuntu 18.10. Working through 'Beginning COBOL for Programmers' by Michael Coughlan. GnuCOBOL has been compiling the book's examples without trouble up until Chapter 9, when this program: IDENTIFICATION DIVISION. PROGRAM-ID.…
6
votes
4 answers

How to avoid hardcoding credentials inside a COBOL program?

I have the following code to connect to an external DB inside a COBOL program: MOVE 'I2SFG04' TO WK-USER MOVE '12345' TO WK-PASS EXEC SQL CONNECT TO :WK-EXT-MACHINE USER :WK-USER USING :WK-PASS END-EXEC. But as you can guess, I…
mllamazares
  • 7,876
  • 17
  • 61
  • 89
6
votes
1 answer

In Mainframe COBOL, How Can I Send a Message to the Console Operator, Wait for a Response, Then Continue?

I have a very long running COBOL program that runs randomly at various times during the day. The Console operator wants to be notified when it starts up and have the program wait so they can go get coffee before letting the job go ahead. How can I…
dstaudacher
  • 546
  • 3
  • 11
6
votes
1 answer

How to write SQLite callback in COBOL

I'm a COBOL programmer , and my latest project is to connect a COBOL application to a SQLite3 database. I have been following this guide, and their solution is exactly what I would need in my COBOL application. I have successfully managed to create,…
6
votes
2 answers

What is the difference between BY CONTENT and BY VALUE in a CALL statement?

What is the difference between BY CONTENT and BY VALUE in a CALL statement in COBOL?
user1804599
6
votes
1 answer

88 Level Number

10 ERROR-FLAG PIC X VALUE 'N'. 88 ERROR-FOUND VALUE 'Y'. 88 ERROR-NOT-FOUND VALUE 'N'. If I do: SET ERROR-NOT-FOUND TO TRUE Then I do: SET ERROR-FOUND TO TRUE Now, what…
Coding man
  • 957
  • 1
  • 18
  • 44
6
votes
1 answer

How to print decimal points in cobol?

I want the data to be in decimal format in the spool. How can I print the data with decimal points. I have used Pic 99v99 for my data-definition, but it is not showing a decimal-point in the result when I DISPLAY it. 12.34 for the value of my data…
Parthi
  • 135
  • 4
  • 14