DATA

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

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"

Properties:

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

Dependencies:

AMODE"31" sets DATA"31" immediately.

Comments:

The DATA directive enables you to control where the Data Division of a program compiled using AMODE(31) 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" or "below-the-line". 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". 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. 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 COBOL MVS compilers provide the DATA compiler option that controls the location of the Data Division for AMODE"31" programs. By default DATA"31" is set, which causes the Data Division to be allocated above the 16Mb line. 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. See your VS COBOL II Application Programming Guide and COBOL MVS & VM V1R2 Programming Guide for further details of the DATA(24|31) compiler option 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.

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

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.