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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.
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!
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" alongand 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=mfinstead of the strict one (but that may means you'd have to use-fno-reserved=ABC/not-reserved: ABCfor reserve words that are used as user-defined names in your COBOL sources.Related
Wish List: #290