Chapter 2: Portability Issues

This chapter describes syntax that the Net Express Compiler can flag, using warning or information error messages, as being incompatible between Net Express and COBOL for UNIX. However, the Net Express Compiler cannot flag all incompatibilities, so this chapter also describes syntax that you should manually check and change before porting the program to a UNIX system.

If a section is flagged as Not Server Express, the portability issues in that section can be ignored if you are publishing to a UNIX system that has Server Express installed.

Syntax Checking

The default for the INTLEVEL directive, for both Net Express and COBOL for UNIX, is set to 2. This is the value required to create portable intermediate code. However, certain syntax in Net Express COBOL, even when compiled with INTLEVEL"2", generates intermediate code that might not run on UNIX systems.

Therefore, if you set the WARNINGS"2" Compiler directive, the Net Express Compiler flags those syntax structures likely to cause problems if ported to a UNIX system.

Syntax Flagged

Not Server Express:

If you compile a program with the INTLEVEL"2" and WARNINGS"2" directives set on Net Express, various syntax structures are flagged. The flags are in the form of information or warning messages. You can increase the severity of an informational or warning message to a severe error using the CHANGE-MESSAGE Compiler directive. The following syntax is flagged:

Syntax Not Flagged

The following syntax is not flagged, but you should check for occurrences in your programs:

You should also be aware of the following differences between COBOL for UNIX and Net Express COBOL:

Using the LINKCOUNT Directive

Not Server Express:

The COBOL for UNIX Compiler has a different mechanism to the Net Express Compiler for allocating storage slots for data items. Therefore, programs that work when compiled using Net Express might give the Compiler error:

0067 Please recompile using a larger value for the LINKCOUNT directive

when published to the UNIX system. If this happens you should set the LINKCOUNT directive in the program causing the error using a $SET statement in the COBOL source program.

Debugging and .idy Files

Not Server Express:

The format of .idy files is different between the Net Express and Object COBOL Development System 4.1 and earlier versions of COBOL for UNIX. Hence, you cannot use the .idy file created by Net Express on these systems.

Object-Oriented Programs

Not Server Express:

In Object COBOL for UNIX you need to specify the MFOO Compiler directive to check Class and OO programs. This directive loads the OO COBOL reserved words. Net Express accepts the MFOO directive, but ignores it, as all the OO COBOL reserved words are already loaded by default.

To develop an OO program or class under Net Express, and then recompile it using COBOL for UNIX, you need to specify the MFOO directive. This is best done by setting the directive using a $SET statement in the source code.

You should also be aware of the following:

CGI Applications

The various versions of COBOL for UNIX provide differing levels of support for the syntax and run-time support required by CGI applications. For example, Object COBOL for UNIX introduced the ACCCGI run-time support module.

The UNIX Option provides a standard level of CGI syntax and run-time support for all COBOL for UNIX products. If the COBOL for UNIX product provides its own syntax or run-time support, this is automatically used by the UNIX Option.

Passing Java Structures to COBOL

When working with Java applications, Net Express enables you to pass data from a Java class into the Linkage Section of COBOL programs and Object COBOL methods, providing that the corresponding Java parameter is an Object which implements the mfcobol.lang.Datatype interface. If you are using Server Express version 2.0.11 or later, you can use this feature to publish from Net Express to a UNIX system: this feature is not available on earlier COBOL for UNIX systems.


Copyright © 2007 Micro Focus (IP) Ltd. All rights reserved.