1,770
questions
41
votes
4
answers
51k
views
Issues with ANDs and ORs (COBOL)
I can't seem to get this one part right. I was given a input file with a bunch of names, some of which I need to skip, with extra information on each one. I was trying use ANDs and ORs to skip over ...
33
votes
11
answers
25k
views
Why is COBOL still a preferred language in the business world? [closed]
Even though we have languages like C++, Java, Python, etc., why is COBOL still a preferred language in the business world?
Why was it so popular?
31
votes
4
answers
23k
views
How can duplicates be removed from a file using COBOL?
The input file have records as: 8712351,8712353,8712353,8712354,8712356,8712352,8712355
8712352,8712355
Using COBOL, I need to remove duplicates from the above file and write to an output file. I ...
29
votes
7
answers
20k
views
Is there actually COBOL in .NET?
I was checking Microsoft's Visual Studio page just now and in the advertisements sidebar I suddenly saw an incredible advertisement:
"Net Express is a COBOL development environment for extending ...
25
votes
3
answers
3k
views
Is there a workable approach to use test-driven development (TDD) in a COBOL application? [closed]
Has anyone come across any workable approaches to implementing test-driven development (and potentially behavior-driven development) in/for COBOL applications?
An ideal solution would enable both ...
24
votes
1
answer
22k
views
What is the difference between a variable-blocked format and a fixed-blocked format?
I have encountered these terms in a data file definition document for some data that I'm getting from a Mainframe system.
I failed to find definitions of these terms in any glossary or Google search -...
24
votes
8
answers
26k
views
Reading COBOL datastructures from Java
Is there a way to read COBOL data in a Java program? More concretely I'm confronted with the following case:
I have a file with fixed length records of data. The data definition is done as COBOL ...
24
votes
9
answers
25k
views
Why does COBOL have both `SECTION` and `PARAGRAPH`?
Why does COBOL have both SECTION and PARAGRAPH?
Can anybody explain why the designers of COBOL created both SECTIONs and PARAGRAPHs? These have been around since the initial release of COBOL so I ...
22
votes
5
answers
66k
views
COBOL Data types
I have confusion regarding COBOL data types.
Like in many interviews it is asked to explain the difference between COMP-3 and COMP...
what is the exact difference?
what is the meaning of usage modes ...
22
votes
8
answers
27k
views
What is COBOL used for? [closed]
What is COBOL used for?
18
votes
6
answers
23k
views
Learning COBOL Without Access to Mainframe [closed]
I am a graduate student majoring in Computer Science. My department teaches the majority of its courses using Java (though I did take one course on system architecture that used C to demonstrate ...
18
votes
3
answers
19k
views
COBOL keyword REDEFINES
May I ask, what is the usage of the keyword REDEFINES in COBOL?
I can not understand the manual's definition.
What is the meaning of the following code?
01 WS_CHARGE_TXT_8X ...
17
votes
6
answers
12k
views
Cobol web development/hosting resources [closed]
I'm employed at a fairly big company here in Germany and got the job to create the main website for it which will feature:
Static contents; Information and Presentations
An employee area (around 6000 ...
16
votes
2
answers
43k
views
Converting EBCDIC to ASCII in java
I am supposed to convert an EBCDIC file to ASCII by using Java. So far I have this code:
public class Migration {
InputStreamReader reader;
StringBuilder builder;
public Migration(){
...
15
votes
3
answers
2k
views
Need help with my COBOL homework
Sorry to bother you all but I am stuck on my homework for COBOL. I've made two attempts, neither of which is working as expected.
The two attempts and their output are shown below followed by the ...
15
votes
6
answers
2k
views
Cobol: science and fiction [closed]
There are a few threads about the relevance of the Cobol programming language on this forum, e.g. this thread links to a collection of them. What I am interested in here is a frequently repeated claim ...
15
votes
2
answers
1k
views
How to run cobc without an input source file, but via a pipe?
Is it possible to execute COBOL code without providing input files? I'm using cobc.
I tried to pipe the code to the cobc process:
$ cat my-input.cbl | cobc
cobc: No input files
To compile a file ...
13
votes
10
answers
6k
views
Does it make sense to study COBOL? [closed]
I have had a talk with a friend of mine about the relative vulnerability of different types of IT workers to unexpected unemployment (e.g. layoffs, company going out of business, obsolete skills ...
13
votes
4
answers
104k
views
In Cobol, to test "null or empty" we use "NOT = SPACE [ AND/OR ] LOW-VALUE" ? Which is it?
I am now working in mainframe,
in some modules, to test
Not null or Empty
we see :
NOT = SPACE OR LOW-VALUE
The chief says that we should do :
NOT = SPACE AND LOW-VALUE
Which one is it ?
...
13
votes
1
answer
7k
views
Why does COBOL have to be indented? [closed]
Why does COBOL have to be indented, as in, have additional spacing in each sourcefile?
Consider this code (note the additional whitespace):
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
...
13
votes
3
answers
570
views
Unprintable integer pointer returned to GNU COBOL from C library
I am learning COBOL just for the fun of it and now want to call C functions from my COBOL source (using GnuCOBOL).
I can call C functions just fine, however I have a small problem with a function of ...
13
votes
3
answers
6k
views
Read STDIN (SYSIN) in COBOL
I want to read the lines out of STDIN (aka SYSIN) in COBOL. For now I just want to print them out so that I know I've got them. From everything I'm reading it looks like this should work:
...
12
votes
3
answers
5k
views
What are the advantages of pseudo conversational vs conversational CICS programming?
I am trying to understand the differences between pseudo conversational and conversational CICS programming. What are the advantages and disadvantages of each approach?
12
votes
2
answers
5k
views
Dynamically Reading COBOL Redefines with C#
I'm making a C# program that will be able to dynamically read an IBM HOST Copybook written in COBOL and generate an SQL table off of it. Once the table is generated I can upload a file into my program ...
12
votes
1
answer
1k
views
Error with gmp when compiling helloworl in COBOL
I want to run this hello world program, in COBOL :
Identification Division. program-id. HelloWorld.
Procedure Division.
Display 'Bonjour '.
Display 'Comment allez vous ? ' .
goback.
But, I have this ...
12
votes
2
answers
2k
views
Japanese COBOL Code: rules for G literals and identifiers?
We are processing IBMEnterprise Japanese COBOL source code.
The rules that describe exactly what is allowed in G type literals,
and what are allowed for identifiers are unclear.
The IBM manual ...
11
votes
5
answers
626
views
What's this language?
A former co-worker left us with thousands of lines of code looking like this. This is more a curiosity, since I rewrote everything he did in less obscure languages :-)
Nevertheless I'm curious. Is ...
11
votes
7
answers
2k
views
The unmentioned parts of COBOL's history [closed]
I'm very curious about old programming languages, especially COBOL, and as Wikipedia couldn't really tell me much about this topic, I decided to ask it here:
Was COBOL the first programming language ...
11
votes
7
answers
9k
views
Calling a Web Service from COBOL or CL
I'm using AS400 and I have been asked to call a web service from the green screen.
How can thisbe this achieved?
Any sample COBOL or CL code would be very helpful.
10
votes
2
answers
12k
views
Setting up COBOL Compiler under Mac OS?
In my university, we're being taught COBOL, and I'm trying to get a head start and learn COBOL, C++, and Java before I get into the classes next year.
Problem is; COBOL is so old, it's hard to grab ...
10
votes
2
answers
39k
views
Problem with COBOL move to comp-3 variable
I'm having the following problem in a COBOL program running on OpenVMS.
I have the following variable declaration:
01 STRUCT-1.
02 FIELD-A PIC S9(6) COMP-3.
02 ...
10
votes
2
answers
565
views
COBOL - Differing answer from mainframe to PC for same COMPUTE
I have this very simple dummy COBOL program which does a dummy COMPUTE and displays the result.
ID DIVISION.
PROGRAM-ID. DUMMYPGM.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 NUM-A PIC ...
9
votes
16
answers
2k
views
What's the bright side of Cobol? [closed]
I love spending my time investigating cool features of languages, even if I won't have a chance to use them anytime soon, but keep hearing only bad things about Cobol, but I'm sure it must of had some ...
9
votes
5
answers
20k
views
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 ...
9
votes
5
answers
11k
views
What is it about COBOL and its performance that makes it (compared to its age) so quick?
Reading through some of the questions here, the general concensus seems to be that there to continues to be an enourmous amount of COBOL code "out there", not just because it's a nightmare to refactor ...
9
votes
5
answers
24k
views
How does COBOL store and retrieve data? [closed]
I'm starting to learn about COBOL. I have some experience writing programs that deal with SQL databases and I guess I'm confused how COBOL stores and retrieves data that is stored in a mainframe for ...
9
votes
6
answers
4k
views
Is there a static analysis tool for Python, Ruby, Sql, Cobol, Perl, and PL/SQL? [closed]
I am looking for a static analysis tool for Python, Ruby, Sql, Cobol, Perl, PL/SQL, SQL similar to find bugs and check style. I am looking for calculating the line count, identify bugs during the ...
9
votes
2
answers
2k
views
GnuCOBOL failing to find dynamic symbols, only on recent Ubuntu
Something changed recently, I think.
GnuCOBOL relies on dynamic linking, symbols looked up with dlsym at run-time. This CALL run-time support code has been in OpenCOBOL for some 7 years now. It no ...
8
votes
3
answers
13k
views
Reading a Cobol generated file
I’m currently on the task of writing a c# application, which is going sit between two existing apps. All I know about the second application is that it processes files generated by the first one. The ...
8
votes
8
answers
2k
views
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 ...
8
votes
4
answers
67k
views
how to format a number to S9(5)V99 ascii in .net
I've been searching for s9(5)v99 but got different information and not really clear. Could someone shows how or the formula to convert. thanks
8
votes
7
answers
1k
views
Cobol technical demonstration [closed]
I'm working as a COBOL programmer - have a 6 months work experience - for a consulting firm . Today, with the rest the COBOL "department", I had a meeting with the new director of my company.
After ...
8
votes
3
answers
927
views
What is the logic behind COBOL paragraph numbering?
I've seen the following paragraph naming structure lots of times:
nnnn-PARAGRAPH-NAME.
Where nnnn stands for a 4 digit number.
Here is a complete example:
0000-MAINLINE.
PERFORM 1000-...
8
votes
1
answer
667
views
Function ord works only sometimes but sometimes not
I am trying to programm some kind of Caesar Cipher in Cobol. But somehow I get the following compile error:
Numeric function "INTEGER FUNCTION ORD" was not allowed in this context.
This error gets ...
8
votes
5
answers
1k
views
A Strange Error (COBOL)
Hey all, got one mountain of a problem here. I have completed a program I had to do for college homework, but when I run it the output shows almost nothing it is suppose to. This only happens when I ...
8
votes
3
answers
62k
views
compute rounded in cobol
I am confused with the rounded in the compute function in cobol.
Declaration:
VAR-A PIC S9(9)V99 COMP-3.
VAR-B PIC S9(9)V9(6) COMP-3.
Procedure.
MOVE +12.08 TO VAR-A.
MOVE +6.181657 TO ...
8
votes
1
answer
929
views
Move record from Oracle array to Cobol occurs
How can I move a record from oracle to a Cobol array?
When I move a single field, everything works as expected.
When I try to move a record in an Oracle VARRAY I cannot
get it to work. The PRO*COBOL ...
7
votes
4
answers
666
views
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 ...
7
votes
6
answers
8k
views
What are some good resources for getting started with COBOL programming? [closed]
I'm thinking about learning COBOL. Where should I start?
7
votes
1
answer
6k
views
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 / ...