Mainframe Pointers

To provide compatibility with mainframe-style pointers in COBOL programs, this system:

AMODE Compiler Directive

You need the AMODE directive for any program module which:

This system also provides and sets the DATA Compiler directive that can control the placement of the Data Division of a program compiled using the AMODE Compiler directive.

The following table shows the settings for AMODE and DATA that are required for a number of COBOL dialects:

COBOL Dialect Directive
COBOL 370 AMODE(31) DATA(31)
VS COBOL II (all releases) AMODE(31) DATA(31)
OS/VS COBOL AMODE(24)

You must specify the appropriate settings for these directives depending on the dialect you are using.

Related Topics:

Accessing Data in a Canceled Program

On the mainframe, a COBOL program can continue to use the data defined in the Data Division of a subprogram even after that subprogram has been canceled. This facility has been emulated in this system, although we do not recommend it as good practice.

You can enable this facility by using the mfpm_access_cancelled_data tunable.

Before the subprogram is canceled, you should set pointer variables in the calling program to the addresses of the data in the subprogram that you want to continue to use. Then, after the subprogram is canceled, you can continue to use that data until the system releases the Working-Storage Section of the canceled subprogram. This can occur if:

Any attempt to use a pointer variable that still points to a released Working-Storage area will have unpredictable results.

Related Topics: