Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Platform-specific features on Windows systems

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".

All the programs in the openUTM Quickstart Kit are suitable for use with the COBOL compiler.

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 <visualcoboldir>\base\bin\CreateEnv.bat.

>

Extend the COBCPY environment variable by adding the directory %UTMPATH%\copy-cobol85.

>

Extend the INCLUDE environment variable by adding <path>\include, where<path> is the installation directory of the COBOL compiler (required for the compilation of the root sources).

>

If you create programs based on CPIC, TX or XATMI under openUTM, extend the COBCPY environment variable as follows:
%UTMPATH%\<interface>\copy-cobol85, where <interface> stands for cpic, tx or xatmi.

>

If you create client programs based on UPIC-L, extend the COBCPY environment variable by adding %UTMPATH%\upicl\copy-cobol85.

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 SPECIAL-NAMES paragraph must be inserted to define the WINAPI call convention:

SPECIAL-NAMES.

CALL-CONVENTION 74 is WINAPI.

>

Each call of the CPIC or XATMI interface must comply with this convention. For example:

CALL WINAPI“CMACCP“ USING CONVERSATION-ID CM_RETCODE