IBM Hexadecimal Format Floating Point Data

Net Express enables you to use floating point data in either IEEE or IBM hexadecimal formats, enabling you to share floating point data seamlessly between mainframe and PC. This chapter describes how to use the different floating point formats in Net Express.

Using Different Floating Point Formats

The following sections describe how you use the different formats of floating point data in Net Express.

Compiling

When compiling a program that always requires the use of a particular format of floating point data items, you use the NATIVE-FLOATING-POINT directive. Setting NATIVE-FLOATING-POINT specifies that IEEE format floating point data items are used, regardless of the setting of the MAINFRAME_FLOATING_POINT environment variable. Setting NONATIVE-FLOATING-POINT causes the floating point format to be determined by the MAINFRAME_FLOATING_POINT environment variable.

See the section Running for information on the MAINFRAME_FLOATING_POINT environment variable and NATIVE-FLOATING-POINT for more information on the NATIVE-FLOATING-POINT Compiler directive.

Running

You control the floating point format that is used at run-time using either of the following:

If both are specified, the setting of the MAINFRAME_FLOATING_POINT environment variable overrides the setting of the mainframe_floating_point tunable.

The MAINFRAME_FLOATING_POINT Environment Variable

Possible formats for the MAINFRAME_FLOATING_POINT environment variable are IBM hexadecimal and IEEE.

Syntax:
SET MAINFRAME_FLOATING_POINT=fp-status
Parameters:
fp-status Which format to use for floating point data items. This must be one of:
true Specifies that IBM hexadecimal format floating point data items are to be used.
false Specifies that IEEE format floating point data items are to be used.
Comments:

Setting MAINFRAME_FLOATING_POINT to anything other than "true" has the same effect as setting it to "false".

The setting of this environment variable can be overridden by the NATIVE-FLOATING-POINT directive. See NATIVE-FLOATING-POINT for more information.

You must set the MAINFRAME_FLOATING_POINT environment variable from a Net Express command prompt before you start Net Express for it to take effect.

Editing Data Files

When editing data files, you can specify whether floating-point data items are interpreted as IEEE format or IBM hexadecimal format. To do this, you use a new drop-down list on the Data File Toolbar, as shown below:

File Toolbar Showing the Floating-point Format Drop-down List

Figure 1: File Toolbar Showing the Floating-point Format Drop-down List

Select the format you want to use from the list, and the floating-point data items are displayed in the format you choose. The default is determined by the setting of the MAINFRAME_FLOATING_POINT environment variable.

Note: You cannot edit floating-point data in the Data File Editor.

Range

IBM hexadecimal format floating point data items must contain values in the following ranges:

Type Minimum Value Maximum Value
COMP-1 5.5E-79 7.2E75
COMP-2 5.5E-79 7.2E75