GnuCOBOL - annoying warning

Discussion in 'Mac Programming' started by akimoriRyuuji, Nov 12, 2015.

  1. akimoriRyuuji macrumors regular

    akimoriRyuuji

    Joined:
    Jun 28, 2015
    #1
    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.
     
  2. mikepolinske macrumors newbie

    mikepolinske

    Joined:
    Mar 31, 2011
    Location:
    Milwaukee, WI
    #2
    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.
     
  3. akimoriRyuuji thread starter macrumors regular

    akimoriRyuuji

    Joined:
    Jun 28, 2015
    #3
    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!
     
  4. mikepolinske macrumors newbie

    mikepolinske

    Joined:
    Mar 31, 2011
    Location:
    Milwaukee, WI
    #4
    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!
     
  5. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #5
    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.
     
  6. mrichmon macrumors 6502a

    Joined:
    Jun 17, 2003
    #6
    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.
     

Share This Page