You can create COBOL programs with the compiler from Micro Focus.
This subsection describes the following compiler-specific characteristics:
Generation
Keywords
Environment variables
Compilation of COBOL program units
Using the CPIC and XATMI COBOL interfaces
For details on linking applications, see the manual openUTM manual “Using UTM Applications on Unix, Linux and Windows Systems”, subsection "Linking a UTM process on Unix and Linux systems".
Generation
At generation you must specify the following kdcdef statement for these programs:PROGRAM
objectname, COMP=MFCOBOL [,SHARED-OBJECT=
shared_object_name]
Keywords
Micro Focus COBOL compiler include the keywords OBJECT-ID, RESTRICTED and USER. These keywords clash with names in the COPY elements of the UTM interfaces. There are two ways of preventing such conflicts.
If the COBOL program units are not object-oriented, some compilers offer the possibility to specify the compiler options REMOVE(OBJECT-ID), REMOVE(RESTRICTED) and REMOVE(USER) at compilation.
If the compiler does not provide the REMOVE functionality or if you want to preserve object-oriented functionality, you must modify the COPY statements as follows, for example:
COPY COPY-Element REPLACING OBJECT-ID BY NEW-OBJECT-ID.
COPY COPY-Element REPLACING RESTRICTED BY NEW-RESTRICTED.
COPY COPY-Element REPLACING USER BY NEW-USER.
The new names must be used when data access is performed.
Reserved keywords when CPIC is used
In Micro Focus COBOL, TIMEOUT is a reserved word. However, since this word is contained in the COBOL copy CMCOBOL on account of the CPIC specification, this name must be replaced in the source. For example:
COPY CMCOBOL REPLACING TIMEOUT BY CPIC-TIMEOUT.
Environment variable
Perform the following steps if you use Micro Focus COBOL program units:
| For Visual Cobol: Call the command script |
| Extend the COBCPY environment variable by adding the directory |
| Extend the INCLUDE environment variable by adding |
| If you create programs based on CPIC, TX or XATMI under openUTM, extend the COBCPY environment variable as follows: |
| If you create client programs based on UPIC-L, extend the COBCPY environment variable by adding |
Compiling a COBOL program unit
You compile programs by entering the command cobol
in a prompt window.
If the program is to be animated, it must be compiled by means of the cobol /ANIM
command.
Using the CPIC and XATMI COBOL interfaces
COBOL programs that use the CPIC or XATMI interfaces must be adapted for use with a MicroFocus compiler because of the Windows call conventions used.
| Before the DATA DIVISION, the following
|
| Each call of the CPIC or XATMI interface must comply with this convention. For example:
|