Menu

CONFIGURATION-SECTION header missing

2022-09-07
2022-09-07
  • Dave Davidson

    Dave Davidson - 2022-09-07

    Hi,

    I have some 1990s MF VS COBOL-II code that I want to compile and most of the modules generate errors at compile time:

    error CONFIGURATION SECTION header missing
    error INPUT-OUTPUT SECTION header missing
    error FIILE-CONTROL header missing
    error DATA-DIVISION header missing

    It's true that they are indeed missing. Example:

       IDENTIFICATION DIVISION.
       ENVIRONMENT DIVISION.
        special-names. console is crt.
      *
           select f1-ise assign to f1-ise-drive
           organization INDEXED
           access DYNAMIC
           status is f1-status lock mode is MANUAL
      *
       FILE SECTION.
    
       fd  f1-ise.
       copy "f1.lib".
    
       WORKING-STORAGE SECTION.
    

    This code compiled back in the day. possibly with warnings but it certainly compiled.

    I can fix it by adding the headers but I wonder if there is a compatibility option so I can keep the code as it always was? This sample will also fail for missing PROGRAM-ID

    Thanks in advance

     

    Last edit: Dave Davidson 2022-09-07
  • Simon Sobisch

    Simon Sobisch - 2022-09-07

    Should work with -std=mf or (less intrusive) with `-frelax-syntax-checks

     
  • Anonymous

    Anonymous - 2022-09-07

    Thank you. -frelax-syntax-checks allows the source to compile. I was already using -std=mf

    I apologise for not using the relax option before posting. I had seen the option but had omitted to apply it.

     
    • Vincent (Bryan) Coen

      On 07/09/2022 22:01, noreply@sourceforge.net wrote:

      Thank you. -frelax-syntax-checks allows the source to compile. I was
      already using -std=mf

      I apologise for not using the relax option before posting. I had seen
      the option but had omitted to apply it.

      Some years back I converted a lot of programs from OS/VS II to what was
      I think the latest version of Open Cobol (GnuCobol) - this may have been
      MF Workbench - such a long time ago :)

      The way I did it was to examine a few of the programs by type then wrote
      a program (Cobol what else?) to read each one adding the missing
      elements including program-id, and Division and Sections.

      I run it against around 20 - 30 then run through cobc to find out what I
      missed, changed the program and re-run then did the lot which was around
      500+ programs.

      Since then they have had a few upgrades to more reflect running under
      Linux etc along with many functional changes but it did save a heck of a
      lot of time.

      The biggest issue was the copy books but luckily the problems with those
      was fairly consistent.

      In the end the code was merged with a version running under MF Workbench
      but as I said it saved a lot of time most of which I did not get paid for.

      Vince

       

Anonymous
Anonymous

Add attachments
Cancel