DATA

Enables AMODE"24" or AMODE"31" programs to access pointers to Data Division items passed to them by AMODE"31" or AMODE"64" programs respectively.

Syntax:

 >>-.---.--------DATA--"format"-------------><  
    +-/-+ 

Parameters:

format
The method of loading of the Data Division:
24
Forces the Data Division to be loaded "below-the-line".
31
Forces the Data Division to be loaded "above-the-line".
64
Forces the Data Division to be loaded "above-the-bar".

Properties:

Default: DATA"31" if AMODE"31" is set. DATA "64" if AMODE"64" is set.
Phase: Syntax check
$SET: Initial

Dependencies:

AMODE"31" sets DATA"31" immediately. AMODE"64" sets DATA"64" immediately.

Comments:

The DATA directive enables you to control where the Data Division of a program compiled using AMODE"31" or AMODE"64" program is loaded.

When the COBOL run-time system loads a program compiled with the AMODE directive, it registers the program's Data Division with the Mainframe Pointer Manager (MFPM) as "above-the-line", "below-the-line", or "above-the-bar" . If you specified AMODE"31", the program is registered as "above-the-line"; if you specified AMODE"24", the program is registered as "below-the-line"; if you specified AMODE"64", the program is registered as "above-the-bar". All POINTER variable operations subsequently performed by AMODE programs use mainframe addresses assigned by MFPM.

As long as POINTER variables that address items in the Data Division of a program compiled with AMODE"31" are not passed to an AMODE"24" program, programs compiled with AMODE"31" and AMODE"24" can safely coexist in the same run-unit. Similarly, as long as POINTER variables that address items in the Data Division of a program compiled with AMODE"64" are not passed to an AMODE"31" program, programs compiled with AMODE"64" and AMODE"31" can safely coexist in the same run-unit.

However, if such POINTERs are passed, an error 114 (at best), or unexpected execution behavior (at worst), will occur.

On the mainframe, the VS COBOL II and Enterprise COBOL for z/OS compilers provide the DATA compiler option that controls the location of the Data Division for AMODE"31" programs. Similarly, the Enterprise COBOL 6.3 for z/OS compiler provides a DATA directive, which allows an AMODE 64 COBOL program to specify the location of data items in the WORKING-STORAGE section following the directive.

By default, DATA"31" is set for AMODE"31" programs and DATA"64" is set for AMODE"64" programs, which causes the Data Division to be allocated above the 16Mb line or 2Gb bar respectively. However, if you need a program compiled using AMODE"31" to pass data to an AMODE"24" program, you can specify DATA"24" to force the Data Division to be allocated below the 16Mb line. Similarly, if you need a program compiled using AMODE"64" to pass data to an AMODE"31" program, or vice versa, you can specify DATA"31" to force the Data Division of the AMODE"64" program to be allocated below the 2Gb bar. See your VS COBOL II Application Guide and Enterprise COBOL for z/OS, v6.3 Programming Guide for further details of the DATA(24|31), LP(32|64) compiler options and DATA directive and mixed AMODE applications.

You can specify DATA"24" with AMODE"31" to force the Data Division to be loaded below the 16 Mb line or you can specify DATA"31" with AMODE"64" to force the Data Division to be loaded below the 2Gb bar.

You cannot use the DATA directive with AMODE"24".

AMODE"64" programs are only supported in a 64-bit run-time environment, and therefore an AMODE"31" program calling an AMODE"64" program or called from an AMODE"64" program must be compiled using the P64 directive. Currently, calls between AMODE"64" and AMODE"31" programs are not supported in .NET/JVM COBOL 64-bit run-time environments.

The DATA directive cannot be used for programs that need to call a Micro Focus library routine or an external API that expects pointer items to be in the native machine format.