Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

akimoriRyuuji

macrumors regular
Original poster
Jun 28, 2015
115
84
Hello everyone!
So, I am using brew to install various tweaks in terminal. For some of my classes, we're doing COBOL (yes, I'm not joking) since we have a mainframe component to cover.

So, as much as I hate COBOL, I'd like to stick to using OS X rather than using the MicroFocus Visual COBOL Compiler my school provided (especially since it's a Windows-only program that is supposed to integrate into Visual Studio). So I discovered GNU COBOL.

I had the hardest time getting it to work once I installed it in brew. Turns out that a number of C libraries like libcob and gmp need to be installed. So eventually I found out you can get it to work if you install some command line tools that are part of XCODE.

So that's the background.
So, I have I start to compile my assignments and they compile fine... EXCEPT I get an unrelated warning about an explicit call to some C function that COBOL uses for displaying numbers. Code still runs and nothing's wrong with my syntax or anything, so it appears to be a COBOL issue. So I uninstalled GNU-COBOL and installed the older OPEN-COBOL. Warning disappears. Weird.

Except for this: "Warning: RECORD clause ignored for LINE SEQUENTIAL"
What gives?

The code that would generate that warning would be when I open my input and output files.
Code:
15        ENVIRONMENT DIVISION.
16        INPUT-OUTPUT SECTION.
17        FILE-CONTROL.
18       * Input file
19        SELECT F01-INVENTORY-FILE ASSIGN TO 'ASST2.dat'
20                ORGANIZATION IS LINE SEQUENTIAL.
21       * Output file
22        SELECT F02-REPORT-FILE ASSIGN TO 'ASST2.rpt'
23                ORGANIZATION IS LINE SEQUENTIAL.

I'll be surprised if anyone knows the answer to this as COBOL isn't really used these days.
 

mikepolinske

macrumors newbie
Mar 31, 2011
22
7
Milwaukee, WI
Hello everyone!
So, I am using brew to install various tweaks in terminal. For some of my classes, we're doing COBOL (yes, I'm not joking) since we have a mainframe component to cover.

So, as much as I hate COBOL, I'd like to stick to using OS X rather than using the MicroFocus Visual COBOL Compiler my school provided (especially since it's a Windows-only program that is supposed to integrate into Visual Studio). So I discovered GNU COBOL.

I had the hardest time getting it to work once I installed it in brew. Turns out that a number of C libraries like libcob and gmp need to be installed. So eventually I found out you can get it to work if you install some command line tools that are part of XCODE.

So that's the background.
So, I have I start to compile my assignments and they compile fine... EXCEPT I get an unrelated warning about an explicit call to some C function that COBOL uses for displaying numbers. Code still runs and nothing's wrong with my syntax or anything, so it appears to be a COBOL issue. So I uninstalled GNU-COBOL and installed the older OPEN-COBOL. Warning disappears. Weird.

Except for this: "Warning: RECORD clause ignored for LINE SEQUENTIAL"
What gives?

The code that would generate that warning would be when I open my input and output files.
Code:
15        ENVIRONMENT DIVISION.
16        INPUT-OUTPUT SECTION.
17        FILE-CONTROL.
18       * Input file
19        SELECT F01-INVENTORY-FILE ASSIGN TO 'ASST2.dat'
20                ORGANIZATION IS LINE SEQUENTIAL.
21       * Output file
22        SELECT F02-REPORT-FILE ASSIGN TO 'ASST2.rpt'
23                ORGANIZATION IS LINE SEQUENTIAL.

I'll be surprised if anyone knows the answer to this as COBOL isn't really used these days.

I'm not familiar with GNU Cobol, but I'd suggest going to the Discussion page at http://sourceforge.net/projects/open-cobol/

Also, if you are comfortable using Eclipse, there is a free product ElasticCobol http://heirloomcomputing.com/elasticcobol/

I'm not a fan of Eclipse, so I really didn't care for the product.
 

akimoriRyuuji

macrumors regular
Original poster
Jun 28, 2015
115
84
GNU COBOL is the newer version of Open COBOL. Rather, it is Open COBOL but they don't call it Open COBOL anymore. Nah I'd rather avoid Eclipse, but thanks for the suggestion!

I'll look at the discussions later. I did a cursory glance but hadn't found anything. But I'll keep looking.
thanks again!
 

mikepolinske

macrumors newbie
Mar 31, 2011
22
7
Milwaukee, WI
I had looked at Open Cobol a few years ago and at the time it seemed to hard to configure.

I tried Veryant's isCobol, but that was kind of pricey and was also Eclipse based.

I've tried NetCobol on Windows unfortunately they don't have a Mac version.

I may give Gnu Cobol a try once they finally release version 2.0.

Good luck!
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,613
6,148
I think the best solution is probably just to install Windows and use whatever your school has provided you.

That or just go to your school computer labs. Don't fight it - it's just for one class for one semester. It's not worth the effort to find an alternative.
 
  • Like
Reactions: Beachguy

mrichmon

macrumors 6502a
Jun 17, 2003
873
3
Except for this: "Warning: RECORD clause ignored for LINE SEQUENTIAL"
What gives?

The code that would generate that warning would be when I open my input and output files.
Code:
15        ENVIRONMENT DIVISION.
16        INPUT-OUTPUT SECTION.
17        FILE-CONTROL.
18       * Input file
19        SELECT F01-INVENTORY-FILE ASSIGN TO 'ASST2.dat'
20                ORGANIZATION IS LINE SEQUENTIAL.
21       * Output file
22        SELECT F02-REPORT-FILE ASSIGN TO 'ASST2.rpt'
23                ORGANIZATION IS LINE SEQUENTIAL.

I'll be surprised if anyone knows the answer to this as COBOL isn't really used these days.

It's been many years since I last wrote COBOL. But based on the error it would appear that the rest of your code is trying to read/write records from the files that you are defining as LINE SEQUENTIAL. File I/O in COBOL comes in several variants and it is necessary to match the file organization definition to the style of file I/O used.

Record-based I/O is usually used to either a) access a database, or b) read from a binary formatted file that contains multiple instances of the fixed-length record. Different COBOL compilers and runtime environments provide different sets of file I/O libraries, so this might be a difference between gnuCOBOL and MicroFocus Visual COBOL.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.