Menu

Replicating MAKESYN in cobol.dir file

Anonymous
2023-04-20
2023-04-20
  • Anonymous

    Anonymous - 2023-04-20

    I have inherited a large batch of COBOL code built with a very old MF compiler on Windows XP that my IT team has directed I need to find a way to upgrade. I am hoping that I can use GnuCOBOL to replace the MF compiler and build on more modern Windows OS. There is a cobol.dir directives file that applies to all of my compilations, and I have mapped most of my directives to cobc compiler options. I saw somewhere that the MAKESYN directive (which appears in my cobol.dir file) is supported in GnuCOBOL 3.1.2 using the >> syntax, but I don't want to modify every cobol file I have. Is there a way to specify this directive in a file similar to cobol.dir for MF or on the cobc command line? Thanks!

     
    • Simon Sobisch

      Simon Sobisch - 2023-04-20

      Specifying directives on the command line is the accepted [feature-requests:#290] - patches welcome.

      There was also a discussion about directive files, but something similar is possible with the compiler configuration already; if you only have some options: cobc -std=mf-strict -freserved=A:X -freserved=B:X prog.cob (making both A and B an alias for X), if you have much more you possibly want to create a "anon.conf" along

      # personal compiler configuration for X
      include: "mf-strict.conf"
      name: "MF adjusted"
      reserved   A:X
      reserved   B:X
      

      and use that instead of specifying the std cobc --conf=anon.conf prog.cob.

      If you place your configuration file in the default folder (see cobc --info) then you don't need a path, otherwise use the full path to the file.
      If you want to allow developing with newer features use mf.conf/ -std=mf instead of the strict one (but that may means you'd have to use -fno-reserved=ABC / not-reserved: ABC for reserve words that are used as user-defined names in your COBOL sources.

       

      Related

      Wish List: #290

Anonymous
Anonymous

Add attachments
Cancel